简体   繁体   中英

React Error: Cannot find module './common'

I've scoured the internet for an answer to this, and haven't found anything yet that works. I'm new to using React, but my friend asked for help with some CSS so I cloned his React project from github (the React app is successfully online and he can work on it locally). Repo is here: https://github.com/brandonkun5/TrueAlpha

When I ran npm start, it told me I had no module 'react-scripts', so I ran npm install react-scripts

Now, when I run npm start, I get the following message: internal/modules/cjs/loader.js:638 throw err;

Error: Cannot find module './common'

So far, I've tried:

  • npm del package.json
  • npm del node_modules
  • npm install
  • Moving the folder into a different location
  • Searching the code for 'Require ('common')" and 'Require ('./common')
  • Updating to the last node version

and nothing has worked yet. Any ideas on what could be causing this error?

The file common.js is missing in node_modules/debug/src/common.js. I copied it from another React project of mine and run npm start in the console and then it worked. Try to copy that file from the path above to same path in this project and it should work. Second option is to run "npm install debug" and file will installed and debug folder will be updated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM