Mofe's Blog

nvm is not compatible with the npm config "prefix" option

2018-04-22

问题

nvm is not compatible with the npm config "prefix" option: currently set to "/Users/fabian/.nvm/versions/node/v0.12.7"
Run `nvm use --delete-prefix v0.12.7` to unset it.

原因

brew install yarn 时附带安装的 node 与 nvm 冲突

解决方法

sudo rm -rf  /usr/local/lib/node_modules
rm /usr/local/bin/npm
brew uninstall --force node
brew prune

预防

brew install yarn --without-node

参考

https://github.com/creationix/nvm/issues/855


Mofe Lee

矮油,今天天气不错