npm install error ENOTEMPTY: directory not empty,

11,467

May be deleting node_modules folder and package-lock.json file and then reinstalling npm would resolve your issue.

So, consider the following commands to apply the above operations:

remove node_modules 
remove package-lock.json
npm install 
Share:
11,467

Related videos on Youtube

Memphis Meng
Author by

Memphis Meng

Updated on June 04, 2022

Comments

  • Memphis Meng
    Memphis Meng almost 2 years

    I encountered the following error when I tried to install some new packages using npm install. It happened when I did npm install a-new-package --save and then delete package-lock.json file afterwards to refresh everything.

    npm ERR! code ENOTEMPTY
    npm ERR! syscall rename
    npm ERR! path /Users/memphismeng/Documents/React Programming/Foot-in-The-Door/mobile/fitd/node_modules/@babel/plugin-proposal-decorators
    npm ERR! dest /Users/memphismeng/Documents/React Programming/Foot-in-The-Door/mobile/fitd/node_modules/@babel/.plugin-proposal-decorators-ysLLPQFw
    npm ERR! errno -66
    npm ERR! ENOTEMPTY: directory not empty, rename '/Users/memphismeng/Documents/React Programming/Foot-in-The-Door/mobile/fitd/node_modules/@babel/plugin-proposal-decorators' -> '/Users/memphismeng/Documents/React Programming/Foot-in-The-Door/mobile/fitd/node_modules/@babel/.plugin-proposal-decorators-ysLLPQFw'
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/memphismeng/.npm/_logs/2021-06-15T18_07_01_162Z-debug.log
    

    What went wrong? I also tried npm audit fix --legacy-peer-deps but it didn't work.

  • Ellery Familia
    Ellery Familia over 2 years
    This is happening with a global module for me.. any ideas?