javascript - NPM install is not working [code 128] - Stack Overflow

NPM is not working it's giving permission denied error. Here is the full log:npm ERR! code 128npm

NPM is not working it's giving permission denied error. Here is the full log:

npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github/jonschlinkert/resolve-file.git /root/.npm/_cacache/tmp/git-clone-8b5c9e7d
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-8b5c9e7d': Permission denied
npm ERR!

npm ERR! A plete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-04-11T06_46_34_324Z-debug.log
root@ip-172-31-15-60:/var/www/html/itracker# npm install request
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github/jonschlinkert/resolve-file.git /root/.npm/_cacache/tmp/git-clone-77c3de2c
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-77c3de2c': Permission denied
npm ERR!

npm ERR! A plete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-04-11T06_47_05_916Z-debug.log

What i tried:

  • pletely removed node and NPM and installed.

    sudo chown -R $(whoami) ~/.npm

by following the answer from here: npm throws error without sudo

Note:

I tried to install globally is working. But installing locally is not working. I tried both sudo and normal user.

NPM is not working it's giving permission denied error. Here is the full log:

npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github./jonschlinkert/resolve-file.git /root/.npm/_cacache/tmp/git-clone-8b5c9e7d
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-8b5c9e7d': Permission denied
npm ERR!

npm ERR! A plete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-04-11T06_46_34_324Z-debug.log
root@ip-172-31-15-60:/var/www/html/itracker# npm install request
npm ERR! code 128
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master git://github./jonschlinkert/resolve-file.git /root/.npm/_cacache/tmp/git-clone-77c3de2c
npm ERR! fatal: could not create leading directories of '/root/.npm/_cacache/tmp/git-clone-77c3de2c': Permission denied
npm ERR!

npm ERR! A plete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-04-11T06_47_05_916Z-debug.log

What i tried:

  • pletely removed node and NPM and installed.

    sudo chown -R $(whoami) ~/.npm

by following the answer from here: npm throws error without sudo

Note:

I tried to install globally is working. But installing locally is not working. I tried both sudo and normal user.

Share Improve this question edited Apr 11, 2018 at 7:06 Sarath Kumar asked Apr 11, 2018 at 6:59 Sarath KumarSarath Kumar 1,1462 gold badges18 silver badges42 bronze badges 7
  • try sudo npm install – Basil Battikhi Commented Apr 11, 2018 at 7:04
  • @BasilBattikhi I'm already sudo user. That's why I didn't care about added sudo at the beginning. But I tried worked! – Sarath Kumar Commented Apr 11, 2018 at 7:09
  • you tried what ? – Basil Battikhi Commented Apr 11, 2018 at 7:09
  • @BasilBattikhi sudo npm install – Sarath Kumar Commented Apr 11, 2018 at 7:10
  • does the problem resolved now ? – Basil Battikhi Commented Apr 11, 2018 at 7:10
 |  Show 2 more ments

2 Answers 2

Reset to default 4

try sudo npm install even if you are working on sudo user

Use the latest npm

npm install -g npm 

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745482108a4629603.html

相关推荐

  • javascript - NPM install is not working [code 128] - Stack Overflow

    NPM is not working it's giving permission denied error. Here is the full log:npm ERR! code 128npm

    5小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信