NPM cannot install dependencies - Attempt to unlock something which hasn't been locked

前端 未结 9 1595
独厮守ぢ
独厮守ぢ 2020-12-02 03:59

I\'ve been trying to run an npm install on my package.json file, but I\'m having a lot of trouble. It keeps saying \"Error: Attempt to unlock XXX, which hasn\'t been locke

9条回答
  •  猫巷女王i
    2020-12-02 04:08

    I had the same problem and tried to fix the permission/ownership of npm related files and directories for hours but had no luck with that.

    Suddenly I found that I had ~/.npmrc file with cache entry pointing to a non-existing directory. Removed that cache property to use the default cache location and now it's solved.

提交回复
热议问题