I have a project on Github that ignores the node_modules folder, so I changed my computer and and cloned the repository again. I used the npm-install-all
install all node dependencies, it used to work. But today when doing this and running react-scripts start
I had this problem:
internal/modules/cjs/loader.js:888 throw err; ^ Error: Cannot find module 'which' Require stack: - C:\Users\jessica.marchi\Documents\GitHub\AUDIT-APP\node_modules\react-dev-utils\node_modules\cross-spawn\lib\util\resolveCommand.js - C:\Users\jessica.marchi\Documents\GitHub\AUDIT-APP\node_modules\react-dev-utils\node_modules\cross-spawn\lib\parse.js - C:\Users\jessica.marchi\Documents\GitHub\AUDIT-APP\node_modules\react-dev-utils\node_modules\cross-spawn\index.js - C:\Users\jessica.marchi\Documents\GitHub\AUDIT-APP\node_modules\react-dev-utils\crossSpawn.js - C:\Users\jessica.marchi\Documents\GitHub\AUDIT-APP\node_modules\react-scripts\bin\react-scripts.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15) at Function.Module._load (internal/modules/cjs/loader.js:730:27) at Module.require (internal/modules/cjs/loader.js:957:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (C:\Users\jessica.marchi\Documents\GitHub\AUDIT-APP\node_modules\react-dev-utils\node_modules\cross-spawn\lib\util\resolveCommand.js:4:13) at Module._compile (internal/modules/cjs/loader.js:1068:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:933:32) at Function.Module._load (internal/modules/cjs/loader.js:774:14) at Module.require (internal/modules/cjs/loader.js:957:19) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Users\\jessica.marchi\\Documents\\GitHub\\AUDIT-APP\\node_modules\\react-dev-utils\\node_modules\\cross-spawn\\lib\\util\\resolveCommand.js', 'C:\\Users\\jessica.marchi\\Documents\\GitHub\\AUDIT-APP\\node_modules\\react-dev-utils\\node_modules\\cross-spawn\\lib\\parse.js', 'C:\\Users\\jessica.marchi\\Documents\\GitHub\\AUDIT-APP\\node_modules\\react-dev-utils\\node_modules\\cross-spawn\\index.js', 'C:\\Users\\jessica.marchi\\Documents\\GitHub\\AUDIT-APP\\node_modules\\react-dev-utils\\crossSpawn.js', 'C:\\Users\\jessica.marchi\\Documents\\GitHub\\AUDIT-APP\\node_modules\\react-scripts\\bin\\react-scripts.js' ]
I already tried to update the modules with npm install
. Has anyone been through this and can you help me, please?
Thanks.
I finally got it, If you have the same problem: try:
rm -rf node_modules
then remove your package-lock.json and
npm install
For me it was an xcode issue.
Remove xcode cli tools: sudo rm -r -f /Library/Developer/CommandLineTools
Reinstall: xcode-select --install
Then, delete node modules. Manually or with rm -rf node_modules
Should be good to go: npm install
then npm start
https://github.com/haileemiu/Notes/blob/main/Troubleshooting/npm.md
this problem occur in node version-17 just download version-16 and it works
try:
rm -rf node_modules
remove your package-lock.json
and
npm install
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.