3
1

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 5 years have passed since last update.

nvm で npm の prefix がいつの間にか意図しない状態になっていた

Last updated at Posted at 2019-05-10

1. 意図しない状態

$ npm config get prefix
/usr/local
  • npm install -g xxx やると /usr/local 配下にインストールしようとして、エラーが出る。そもそも、そこに入ってほしくなーい!
  • コピペの賜物かなw

2. このコマンドで戻った

nvm install node && nvm alias default node
  • 最新の node がインストールされちゃったけど。困らんしいいのだが。
  • 最新の node も、元々使っていた node も、期待通りの prefix になったよー。

3. 期待通り

$ npm config get prefix
/Users/higuchi/.nvm/versions/node/v11.13.0

以上

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?