NVM:如何全局设置节点版本?

时间:2017-08-13 06:12:08

标签: javascript npm nvm

使用Node Version Manager时,我可以使用nvm use node将当前目录中的节点版本设置为最新版本。如何指定使用哪个版本?

1 个答案:

答案 0 :(得分:5)

Let's say you have versions v8.2.0 and v8.3.0 installed.

To make version v8.2.0 the currently used one, you can call nvm use 8.2.0.

nvm use also accepts aliases, so you could create one like this: nvm alias mysuperversion 8.2.0 and then make it the current one by calling nvm use mysuperversion.

To make a specific version of Node a global one, you should create a default alias (or modify it if it already exists, the same way you create a new one).