question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Command 'wipe node_modules' failed with code: 1

See original GitHub issue

When 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:open
  • Created 2 years ago
  • Reactions:2
  • Comments:41 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
pmadrugacommented, Oct 22, 2021

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).

2reactions
OnurVarcommented, Sep 27, 2021

@pmadruga, I believe this is a concurrency problem. It seems like executeTask is returning a promise, but on index.js we’re not waiting promise to resolve/reject.

if (options.getWipeiOSBuild()) {
  executeTask(tasks.wipeiOSBuildFolder);
}
if (options.getWipeiOSPods()) {
  executeTask(tasks.wipeiOSPodsFolder);
}
if (options.getWipeSystemiOSPodsCache()) {
  executeTask(tasks.wipeSystemiOSPodsCache);
}

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found