3

here is the error msg from console:

Error: ENOENT: no such file or directory, open 'C:\Code\django\DRF-REACT\node_modules\prop-types\node_modules\react-is\index.js' at Object.../node_modules/prop-types/node_modules/react-is/index.js (has.js:1:1)

at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at Object.../node_modules/prop-types/index.js (index.js:9:1)
at Object.options.factory (react refresh:6:1)
at __webpack_require__ (bootstrap:24:1)
at fn (hot module replacement:62:1)
at Module.../node_modules/@material-ui/core/esm/AppBar/AppBar.js (log.js:59:1)
at Module.options.factory (react refresh:6:1)

The problem is >react-is is outside of prop-types/node_modules and prop-types/node-modules is an empty folder. I tried to move the react-is into the node modules folder in Vscode but it cannot be done.

6 Answers 6

3

Following steps resolved the issue in my react application

  1. Closed VS studio

  2. Run the following commands

    npm update 
    npm audit fix
    npm start 
    
Sign up to request clarification or add additional context in comments.

Comments

2

You might have some complications with your node_modules folder and installing react-is.

A couple ideas:

  1. npm install react-is : make sure the package is installed instead of physically moving it.

  2. rm -rf node_modules : delete node_modules folder and do a fresh npm install

One or both of these could help if you haven't done them already.

1 Comment

I tried both and react-is is now in the right place. Now I'm getting invalid hook call errors probably because I have 2 copies of node_modules, one at app level and one at the project level. I'm following a youtube tutorial and I can see the tutorial has the same folder structure. Don't why mine is not working.
0

Simply closing VS Studio and running npm start solved the problem for me.

1 Comment

This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
0

I only used another (port) and restart my application using command(npm start). after that the problem was solved

Comments

0

close the vs code, close the application and restart both, it works properly.. :) Goes the error...!

Comments

0
  1. Delete node_modules
  2. Delete package.lock.json
  3. run npm clean cache
  4. run npm i
  5. Then run npm start

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.