I get the below-mentioned error when trying to do NPM install in my Dockerfile. I do delete node_modules before running NPM install still I end up with this error.
npm ERR! node v6.2.0
npm ERR! npm v3.8.9
npm ERR! path /nodejsAction/node_modules/setprototypeof
npm ERR! code ENOTEMPTY
npm ERR! errno -39
npm ERR! syscall rmdir
npm ERR! ENOTEMPTY: directory not empty, rmdir
'/nodejsAction/node_modules/setprototypeof'
Any idea how I can fix this? It seems to work properly on my local mac but on my Jenkins server the script fails.
I think the following command might be more appropriate:
rm -r node_modules
This will remove the node_modules
folder in your repository. The command npm install
should work now.
If you are using Webpack, you can also remove the dist
folder using rm -r dist
and re-build your repository.
I had the same issue, i did following:
1. Restart system
2. Close VS, VSCode or any editor that has JS files open.
3. Apparently, you might have to do npm install in other directories too before doing it in target folder.
I had the same error/issue, and I removed the directory.
rm -r node_modules/MODULE
It simply worked!
In my case, the ENOTEMPTY
followed an ERR_SOCKET_TIMEOUT
. It also carried an instruction to rename the module (uuid
to uuid-<some string>
, nanoid
to nanoid-<some string>
)- renaming led to the same issue, with or without verifying the cache. The fix for this, without having to nuke the cache, was to delete both the source and destination modules
rm -r node_modules/<module>
rm -r node_modules/.<module>-<string suffix>
and then continue the install. Quite similar to an answer given here but deleting just the module wasn't enough for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With