npm ERR! Refusing to delete / code EEXIST

前端 未结 12 993
暖寄归人
暖寄归人 2020-12-24 11:17

I\'m just running a simple npm install and i get this error.

npm ERR! path /Users/jasonazoulay/Desktop/fabrick.io/delegation/node_modules/@angul         


        
相关标签:
12条回答
  • 2020-12-24 11:48

    This was how I solved mine after 'googling' around...

    • Navigate to the directory your node was installed in
    • rename your npm.cmd and npm files
    • Try run the installation again
    • If successful..delete the files you renamed earlier npm and npm.cmd
    • if not, :( :(

    The cli commands here...in case you don't want to be renaming and stuffs

    cd %ProgramFiles%\nodejs
    ren npm.cmd npm2.cmd
    ren npm npm2 
    npm2 install npm@latest -g
    

    del npm2
    del npm2.cmd
    

    Rolf-schmidiger

    0 讨论(0)
  • 2020-12-24 11:49

    I had a similar error(mine is not @angular),
    resolved by deleting and reinstalling node with installer.

    0 讨论(0)
  • This worked for me

    npm install -g --force gatsby-cli
    

    Thanks

    0 讨论(0)
  • 2020-12-24 11:51

    I got this problem on Linux (npm is the current latest 5.6.0), because I created a tgz archive, and I needed to --dereference some symlinks (see man tar) when creating a tgz archive (which was them copied to VM for testing). This way a lot of symlinks in node_modules/.bin also became regular files. npm says in the error message, .e.g.

    npm ERR! Refusing to delete /path/to/node_modules/.bin/jest: is outside /path/to/node_modules/jest and not a link

    0 讨论(0)
  • 2020-12-24 11:51

    I had the same problem and it turned out the problem was that a stray instance of npm was running somewhere in the background at the same time I was trying to do the install (it was Webpack's npm run serve, to be precise).

    Stopping the running instance resolved the problem.

    0 讨论(0)
  • 2020-12-24 11:51

    For windows users (specific to windows 10) this must solve the problem.

    Goto this folder:

    C:\Users\[UserName]\AppData\Roaming\
    

    delete or rename the npm and npm-cache folders.

    This has fixed my problem in Windows.

    0 讨论(0)
提交回复
热议问题