我已经在Ubuntu上安装了nodejs 8,是否可以安装NVM? [英] Is it possible to install NVM when I already have installed nodejs 8 on Ubuntu?

查看:66
本文介绍了我已经在Ubuntu上安装了nodejs 8,是否可以安装NVM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了nodejs 8,我无法使用angular 1运行业力测试.按照业力官方网站Note: Karma currently works on Node.js 0.10, 0.12.x, 4.x, 5.x, 6.x, and 7.x. See FAQ for more info.的规定,我想问题可能出在我的节点版本上,他们建议通过NVM安装节点,但是我已经安装了节点8..是否可以安装nvm并在其中包含我当前的nodejs?

I have installed nodejs 8, I can't run karma tests with angular 1.. As specified on Karma official website Note: Karma currently works on Node.js 0.10, 0.12.x, 4.x, 5.x, 6.x, and 7.x. See FAQ for more info., I guess problem might be in my node version, they recommend to install node via NVM but I already have installed node 8.. is it possible to install nvm and include there my current nodejs?

推荐答案

问:当我已经安装了现有的node时,我仍然可以安装nvm吗?

Q: Can I still install nvm when I already got an existing node installation?

A:是. nvm通过更改您的PATH环境变量来确定当前Shell会话使用的node版本.

A: Yes. nvm operates by altering your PATH environment variable to determine the node version your current shell session uses.

例如,当执行nvm use 6.10.3时,您立即可以看到$ PATH设置为;

For instance when doing nvm use 6.10.3, you immediately can see that $PATH is set to;

PATH =/home/samuelt/.nvm/versions/node/v6.10.3/bin

PATH=/home/samuelt/.nvm/versions/node/v6.10.3/bin

which node决定解决

/home/samuelt/.nvm/versions/node/v6.10.3/bin/node

/home/samuelt/.nvm/versions/node/v6.10.3/bin/node

由于nvm始终尝试将其node安装路径设置为PATH中的第一次出现,即使您在PATH中有10个其他节点安装路径,一旦系统将其安装,其余的路径也将被忽略.找到了node二进制文件.

Since nvm always try to set the path of its node installation as the first occurrences in PATH even if you have 10 other node installation paths in PATH, the rest will be ignored once the system has found the node binary.

问::我可以将已安装的Node副本作为已安装节点的一部分包含在nvm中吗?

Q: Can I include my installed copy of Node as part of the installed node in nvm?

A:从理论上讲是可能的.但我会拒绝.要在nvm中安装特定的节点版本,您可以执行nvm install <version>

A: In theory it is possible. But I will say no. To install a particular node version in nvm you'll can do nvm install <version>

这篇关于我已经在Ubuntu上安装了nodejs 8,是否可以安装NVM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆