0
votes

I'm using create-react-app with react-bootstrap and I'm getting this error when I run npm start:

Failed to compile ../node_modules/@restart/context/forwardRef.js

Module not found: Can't resolve 'react' in 'C:\Users...\node_modules@restart\context'

This error occurred during the build time and cannot be dismissed.

I already tried deleting package-lock.json and running npm install again but it didn't help.

1
Check if "react" package exists in ./node_modules folder. Also delete node_modules completely. node_modules will get generated again. Hope this helps. - Priyesh Diukar
Possible duplicate of this - tarzen chugh
Maybe you need to do an npm install? - Damien
Remove node_modules, run npm cache clean and run npm install again. - Amol B Jamkar

1 Answers

0
votes

I got some error. I try to use the below step; It is running eventually.

npm cache clean --force
npm cache verify

Then I deleted node_modules, after that, I run the below code

npm install --force