'internal/modules/cjs/loader.js:888 throw err;
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.
Solution 1:[1]
I finally got it! If you have the same problem, try:
rm -rf node_modules
then remove your package-lock.json and
npm install
Solution 2:[2]
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
Solution 3:[3]
this problem occur in node version-17 just download version-16 and it works
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jessica de Marchi |
| Solution 2 | Hailee |
| Solution 3 |
