updating node.js in windows 7 64 bit

谁说胖子不能爱 提交于 2019-12-12 07:44:54

问题


How to update node.js in Windows 7 64-bit OS?

I tried the famous :

npm cache clean -f
npm install -g n
n stable

But in npm install -g n it failed giving the following error:

C:\Windows\system32>npm install -g n
npm http GET https://registry.npmjs.org/n
npm http 304 https://registry.npmjs.org/n
npm ERR! notsup Unsupported
npm ERR! notsup Not compatible with your operating system or architecture: n@1.2
.9
npm ERR! notsup Valid OS:    !win32
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   win32
npm ERR! notsup Actual Arch: ia32

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "n"
npm ERR! cwd C:\Windows\system32
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code EBADPLATFORM
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Windows\system32\npm-debug.log
npm ERR! not ok code 0

Please suggest a solution. I suspect this could be because of the 64-bit version of the OS.

Thanks and regards.


回答1:


You can update simply by executing the Windows installer for the latest node.js version from here.

n doesn't work on Windows because it's basically a giant (bash) shell script.




回答2:


As @mscdex mentioned in the comment above, you cannot use the bash shell script on Windows.

The correct link to update from Windows would be this one.

Then you should click on the right link saying " Current".



来源:https://stackoverflow.com/questions/24822612/updating-node-js-in-windows-7-64-bit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!