Bojan Mitrovic
Bojan Mitrovic

Reputation: 115

React App failed to compile - Module not found: Can't resolve 'react'

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.

Upvotes: 0

Views: 5237

Answers (1)

Metin Atalay
Metin Atalay

Reputation: 1517

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

Upvotes: 1

Related Questions