Command 'wipe node_modules' failed with code: 1
See original GitHub issueWhen I run the command npx react-native clean-project-auto
I get the following error and the process terminates.
Error running 'wipe node_modules': rm:
Error running 'wipe node_modules': fts_read
Error running 'wipe node_modules': :
Error running 'wipe node_modules': No such file or directory
❌ Command 'wipe node_modules' failed with code: 1
/Users/sushrut/Documents/GitHub/Desora-Smoker-RN/node_modules/@react-native-community/cli/build/index.js:99
const message = err.message.replace(/\.$/, '');
^
TypeError: Cannot read property 'message' of undefined
at handleError (/Users/sushrut/Documents/GitHub/Desora-Smoker-RN/node_modules/@react-native-community/cli/build/index.js:99:25)
at Command.handleAction (/Users/sushrut/Documents/GitHub/Desora-Smoker-RN/node_modules/@react-native-community/cli/build/index.js:189:7)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Library Version: 3.6.4 OS: macOS Big Sur 11.5.2
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:41 (18 by maintainers)
Top Results From Across the Web
How to solve npm install error “npm ERR! code 1”
Try npm cache clean --force. Delete folder node_modules and file package-lock.json.
Read more >Npm Install is failing for SPFx webpart - Microsoft Q&A
Hi @sns1 , To fix this error, you can follow the steps. 1. Delete node modules. npm install rimraf -g; rimraf node_modules.
Read more >Npm install command failing with message "could not find ...
When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops with the error: npm ERR! code...
Read more >NPM install error - Material Design for Bootstrap
You can try to: 1. Delete your node_modules catalog and package-lock.json file 2. Run npm cache clean --force command 3. Install dependencies once...
Read more >How to clean node modules folder of packages that are not in ...
json. rm -rf node_modules/ npm install. This would erase all installed packages in the current folder and only install the dependencies from ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just to give an update - I’ve been working on this fix (although I can’t seem to replicate it). Progress is happening (despite being slightly slow).
@pmadruga, I believe this is a concurrency problem. It seems like
executeTask
is returning a promise, but onindex.js
we’re not waiting promise to resolve/reject.In other words, we’re trying to execute these tasks at the same time without knowing which one will be resolved/rejected first. This is causing node_modules to be removed before
tasks.cleanAndroidProject
which is probably throwing the above.If I execute the process with flag
--keep-node-modules
, everything works fine on my end.