简体   繁体   English

如何在/ usr / local / bin中使用节点,而不是在NVM中使用节点

[英]How to use node in /usr/local/bin instead of the one in NVM

Node is installed on my Mac at /usr/local/bin . Node安装在我的Mac上的/usr/local/bin

Then I installed Node Version Manager and started using it. 然后,我安装了节点版本管理器并开始使用它。 When I type which node , I get /Users/user/.nvm/versions/node/v5.6.0/bin/node for example. 例如,当我输入which node ,我会得到/Users/user/.nvm/versions/node/v5.6.0/bin/node

However, because of issues with other packages, I would like to use the node installed on my Mac (at /user/local/bin ), not the one installed by NVM. 但是,由于其他软件包的问题,​​我想使用Mac上安装的节点(位于/user/local/bin ),而不是NVM安装的节点。

How can I do this? 我怎样才能做到这一点?

Set a symlink like so: 设置符号链接,如下所示:

ln -s /usr/local/bin/node node

Here's a great answer about symlinks on Apple SE: Symlinks 下面是关于如何在苹果SE符号链接一个伟大的回答: 符号链接

You can make nvm default to using the system Node with this: 您可以将nvm默认设置为通过以下方式使用系统节点:

nvm alias default system

Explained here . 在这里解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM