1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【メモ】npm install -gがエラーになった時

Posted at

問題点

npm install -g serveのコマンドを入力したら、以下のエラーが出ました。

スクリーンショット 2021-05-29 16.35.10.png

解決法

  • $ mkdir ~/.npm-global
  • $ npm config set prefix '~/.npm-global'
  • $ echo ' export PATH=~/.npm-global/bin:$PATH' >> ~/.bash_profile
  • $ source ~/.bash_profile

【参考記事】
https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

結果

 無事に解決できました。:sunny:
スクリーンショット 2021-05-29 16.43.05.png

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?