LoginSignup
38
33

More than 5 years have passed since last update.

osxのnpm installをsudo無しで行えるようにする

Last updated at Posted at 2015-03-18

下記コマンドを実行してフォルダの権限を変更すれば、以降はsudo無しでnpm installが可能になります。

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

// -gのnpm installをsudo無しにしたい場合
$ sudo chown -R $(whoami) /usr/local/lib/node_modules

// アプリケーションのnpm installをsudo無しにしたい場合
$ sudo chown -R $(whoami) [nodeアプリケーションのパス]/node_modules

自動デプロイ時などで、sudoのパスワード入力をスキップしたい場合に便利です。

38
33
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
38
33