ERR! ENOTEMPTY: directory not empty, rename, Can you comment the error here?

Can you comment the error here? What do you think is due to this? thank you for your attention

2024-01-03T07:33:14.144Z Remove : interra-io-background-services

2024-01-03T07:33:14.478Z npm remove --no-audit --no-update-notifier --no-fund --save interra-io-background-services
2024-01-03T07:33:28.554Z [err] npm
2024-01-03T07:33:28.561Z [err] ERR!
2024-01-03T07:33:28.563Z [err] code ENOTEMPTY
2024-01-03T07:33:28.565Z [err] npm ERR!
2024-01-03T07:33:28.567Z [err]
2024-01-03T07:33:28.571Z [err] syscall rename
2024-01-03T07:33:28.571Z [err] npm
2024-01-03T07:33:28.573Z [err] ERR! path /data/node_modules/interra-io-background-services
2024-01-03T07:33:28.573Z [err] npm
2024-01-03T07:33:28.575Z [err] ERR!
2024-01-03T07:33:28.577Z [err] dest /data/node_modules/.interra-io-background-services-tFKKQ3t3
2024-01-03T07:33:28.582Z [err] npm ERR! errno -39
2024-01-03T07:33:28.597Z [err] npm
2024-01-03T07:33:28.601Z [err] ERR! ENOTEMPTY: directory not empty, rename '/data/node_modules/interra-io-background-services' -> '/data/node_modules/.interra-io-background-services-tFKKQ3t3'
2024-01-03T07:33:28.632Z [err]
2024-01-03T07:33:28.635Z [err] npm
2024-01-03T07:33:28.637Z [err] ERR! A complete log of this run can be found in:
2024-01-03T07:33:28.637Z [err] npm ERR! /data/.npm/_logs/2024-01-03T07_33_20_234Z-debug-0.log
2024-01-03T07:33:28.683Z rc=217

Search this ↑ and you will see many many similar posts.

The solution is simply to delete the offending dir. In your case /data/node_modules/.interra-io-background-services-tFKKQ3t3

I solved the problem. What I want to ask is what causes this problem. For example, I encounter this problem when uploading a new tgz file from 0.0.1 to 0.0.2. Is it related to the project's package.json? Why does it add --tFKKQ3t3 to the old file? Is this related to npm?

Yes.... and no.

This usually happens when an npm command (e.g. npm install xyz) get terminated before it is finished - typically due to slow (or interrupted) internet, manual interruption (ctrl+c), crash etc.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.