通过安装程序 (MSI) Windows 7 更新 Node.js 时看不到最新版本 [英] Not seeing latest version when updating Node.js via installer (MSI) Windows 7
问题描述
我正在尝试更新 Windows 7 机器上的节点,但在我重新安装/更新节点后看不到最新版本.
I'm trying to update node on my Windows 7 box but I'm not seeing the latest version after I re-install/update node.
我只是去http://nodejs.org/download/ 获取最新的Windows 安装程序,v0.10.28.然后我只运行该安装程序,它默认在我的本地硬盘驱动器上安装所有内容,包括 npm,这很酷,因为我也想升级它.
I'm just going out to http://nodejs.org/download/ and getting the latest Windows installer, v0.10.28. I then just run that installer where it defaults to installing everything on my local hard drive, including npm, which is cool because I wanted to upgrade that as well.
安装运行/完成没有明显问题,但是当我执行以下操作时:
Install runs/finishes with no apparent problem, but when I do a:
node --version
我仍然看到我的旧"版本 v0.10.15,而不是我刚刚安装的最新版本 v0.10.28.我的 npm 版本仍然报告我的旧"版本.
I'm still seeing my "old" version, v0.10.15, not the latest I supposedly just installed, v0.10.28. My npm version still reports my "old" version as well.
我也试过重启.
一个节点/npm 怎么更新?
How the heck does one update node/npm?
推荐答案
我在 MacOS 上遇到了类似的问题,原因是我安装了 nvm
.所以运行大多数网站上的命令:
I had a similar problem but on MacOS and the reason was I had nvm
installed. So running the commands found on most websites:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
不起作用,node -v
仍然显示旧版本.我所做的是从 nvm 安装节点:
didn't work, node -v
still displayed the old version.
What I did was to install node from nvm:
nvm install v0.12.6
这将在您的机器上从头开始构建节点,然后 node -v
将显示正确的版本.我想我仍然可以通过使用 n
来使用以前的命令,然后使用 nvm use v0.12.6
,但这是需要测试的.如果您安装了 nvm
,只需检查 nvm
的命令即可升级节点.
This will build node from scratch on your machine, and then node -v
will display the correct version. I think I could have still used the previous commands by using n
and then do nvm use v0.12.6
, but this is something to test. If you have nvm
installed, just check the commands for nvm
to upgrade node.
这篇关于通过安装程序 (MSI) Windows 7 更新 Node.js 时看不到最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!