I currently have the following versions installed my windows machine.
我目前安装了以下版本的windows机器。
node : v7.3.0
npm : 3.10.10
@angular/cli : 1.4.2
node:v7.3.0 npm:3.10.10@angular/cli:1.4.2
I would like to install latest versions of the above and be able to switch accordingly. To my knowledge installation of node governs that. If I need to install latest npm and angular cli then i would need to install the latest version of node. Please do correct me if I am wrong. Can i globally install the latest version of nodejs. Once I install that could i switch between the node versions. I presume switching between the node versions would take care to use the appropriate npm and cli.
我想安装上面的最新版本,并能够相应地切换。据我所知,节点的安装控制着这一点。如果我需要安装最新的npm和angular cli,那么我需要安装node的最新版本。如果我错了,请务必纠正我。我可以全局安装最新版本的nodejs吗。一旦我安装了它,我就可以在节点版本之间切换了。我认为在节点版本之间切换需要注意使用适当的npm和cli。
更多回答
So if I install latest version of node and then say nvm use the new version and then install latest version of npm and angular cli, would switching between the node versions take the appropriate versions of npm and cli. So i believe when i install npm and angular cli they would be tied to that specific nodejs version installation. I am looking for that kind of ability to switch
因此,如果我安装了最新版本的node,然后说nvm使用新版本,然后安装了最新版的npm和angular cli,那么在节点版本之间切换会采用合适的npm版本和cli版本吗。因此,我相信当我安装npm和angular cli时,它们将与特定的nodejs版本安装绑定。我正在寻找这种转换能力
According to the documentation: "Please note that any global npm modules you may have installed are not shared between the various versions of node.js you have installed." So yes, it sounds like they will be tied to the version of npm
根据文档:“请注意,您可能安装的任何全局npm模块都不会在您安装的各个版本的node.js之间共享。”因此,是的,听起来它们将与npm版本绑定
Perfect that what i was looking for
这正是我想要的
I have installed node version v8.11.2. when i run nvm list i expected it to show both the versions but it shows only 7.3.0. When I run node -v it shows 8.11.0. if i execute nvm use 7.3.0 then i get a message node v7.3.0 (64-bit) is not installed. I am confused
我已经安装了节点版本v8.11.2。当我运行nvm列表时,我希望它显示这两个版本,但它只显示7.3.0。当我运行node-v时,它显示8.11.0。如果我使用7.3.0执行nvm,那么我会得到一个消息节点v7.3.0(64位)没有安装。我很困惑
This is achievable via various version managers.
这可以通过各种版本管理器实现。
For Windows, take a look at NVM for Windows.
对于Windows,请查看NVM For Windows。
For macOS or Linux (not your OS, I see, but for others reading), I like n, and NVM is also widely used.
对于macOS或Linux(我知道不是你的操作系统,但对于其他阅读的人来说),我喜欢n,NVM也被广泛使用。
nvm-windows let's you do that. Before installing nvm-windows, please uninstall all Node
versions from your computer.
nvm窗口让我们来做这件事。在安装nvm窗口之前,请从计算机上卸载所有Node版本。
To install any Node
version, type in command prompt nvm install [node version]
, like for example:
要安装任何Node版本,请在命令提示符下键入nvm install[Node version],例如:
nvm install 10.16.0
nvm install 6.11.0
nvm list
lists all Node
versions you installed:
nvm列表列出了您安装的所有节点版本:
nvm use 6.11.0
or
或
nvm use [version name]
and you will be prompted by a windows pop up to allow nvm-windows to use/switch to a particular Node
version.
并且会弹出窗口提示您允许nvm窗口使用/切换到特定的Node版本。
I set my node version default like this: nvm alias default <version>
我将我的节点版本默认设置为:nvm alias default<version>
更多回答
I've kept the mac and linux info as it's likely that other people reading find this by searching for similar info. Windows is on top though. Thanks for the feedback!
我保留了mac和linux的信息,因为其他人可能会通过搜索类似的信息来找到这些信息。不过,Windows处于领先地位。感谢您的反馈!
So if I install latest version of node and then say nvm use the new version and then install latest version of npm and angular cli, would switching between the node versions take the appropriate versions of npm and cli. So i believe when i install npm and angular cli they would be tied to that specific nodejs version installation. I am looking for that kind of ability to switch
因此,如果我安装了最新版本的node,然后说nvm使用新版本,然后安装了最新版的npm和angular cli,那么在节点版本之间切换会采用合适的npm版本和cli版本吗。因此,我相信当我安装npm和angular cli时,它们将与特定的nodejs版本安装绑定。我正在寻找这种转换能力
I would add, to answer the other parts of his question. Changing your node version does not effect your angular cli version in any way shape or form.
我想补充一点,以回答他的问题的其他部分。更改节点版本不会以任何形式影响angular cli版本。
Nvm on windows not work with latests versions (10.x.x) of nodejs
windows上的Nvm不适用于nodejs的最新版本(10.x.x)
for linux users: There is also a node plugin for asdf-vm
对于linux用户:还有一个用于asdfvm的节点插件
我是一名优秀的程序员,十分优秀!