node.js - 使用nvm后/usr/local/bin/node找不到
PHPz
PHPz 2017-04-17 11:25:47
0
2
657

我知道通过nvm安装后,node的路径在类似于/Users/username/.nvm/v0.10.33/bin/node下。

但是我的sublimeText中有些插件需要指定node的Path。它们默认的是/usr/local/bin/node。结果就会出现找不到的情况。

请问如何保证/usr/local/bin/node能正确执行当前的node版本?


2014-11-25 17:08:41 Update

nvm好像没有修改/usr/local/bin/node指定到当前的版本,所以我们手动创建一个软连接吧:

ln -s /Users/#{username}/.nvm/#{nodeVersion}/bin/node /usr/local/bin/node

如果你切换版本,也记得更新下这个软链接。

PHPz
PHPz

学习是最好的投资!

reply all(2)
大家讲道理

Using n doesn't have this problem, it modifies /usr/local/bin/node.

If you must use nvm, you can consider setting the node path for those plug-ins. Changing it to $HOME/node_modules/.bin/node should be enough.

迷茫

Go to the official website to install the package or use brew to install node

Use nvm only when you want to use the specified version of node

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template