LoginSignup
4
2

More than 3 years have passed since last update.

【npm】root権限で「npm install -g 〇〇」すると『Permission denied』エラーで怒られる時

Last updated at Posted at 2019-06-04

※linux環境想定

root@hoge:/home# npm i -g hogehoge

# 中略
sh: 1: node: Permission denied
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
# 中略

みたいな時

解決

npm config set user 0
npm config set unsafe-perm true
# をそれぞれ実行してから、npm i -g XXX

参考(というか丸々引用) : https://stackoverflow.com/questions/51811564/sh-1-node-permission-denied

こまけぇ事はいいからとにかく
ローカルの仮想開発環境とかでrootで何でもすませちゃいたいものぐさマン(私)はどうぞお試しください

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2