7
7

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 is not compatible with the npm config "prefix" option' と言われた

Posted at

原因

NVM_DIRが参照しているパスがシンボリックリンクだと上記のようなエラーが出てしまうらしい。
今回、nvmをインストールしたユーザの$HOMEが通常と異なるディスクに設定されていてシンボリックリンクとなっていたために発生していた。

参考: https://github.com/creationix/nvm/issues/1385

対応

とりあえず、NVM_DIRにシンボリックリンクが参照しているオリジナルのパスを設定してあげれば良いらしい。

なので、通常 nvm をインストールした際に追加される .bashrc(環境によってファイルは異なる)の NVM_DIR 環境変数を設定している箇所を以下のように修正

~/.bashrc
- export NVM_DIR="$HOME/.nvm"
+ export NVM_DIR="$(readlink -f $HOME)/.nvm"

参考リンク

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?