使用npm install时出错(npm ERR!Windows_NT 6.3.9600)

大家好我遇到以下错误,而试图通过npm安装一个包。 我使用的操作系统是Windows 8.它在Ubuntu上完美运行。 请帮我解决这个问题。

C:\Users\xxxxx>npm install -g jshint npm ERR! registry error parsing json npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\node\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "jshint" npm ERR! node v0.12.4 npm ERR! npm v2.10.1 npm ERR! Unexpected token < npm ERR! <html> npm ERR! <head> npm ERR! </head> npm ERR! <body> npm ERR! We are sorry but this is temporarily unavailable. npm ERR! <!-- Site Not Found. --> npm ERR! </body> npm ERR! </html> npm ERR! npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! <https://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! C:\Users\xxxxx\npm-debug.log 

我得到了这个问题的解决scheme(至less在我的情况下)。 registry的URL是过时的。 请参阅以下链接: 无法使用“npm install”在Node.js中安装任何软件包

谢谢。

就我而言,在Windows上升级npm需要手动步骤来确保PowerShell / CMDfind新版本的npm。 这是微软DX工程师用npm和Node制作的一个小工具,将这个过程简化为一个简单的命令。 欲了解更多详情,请查看npm-windows-upgrade

你可以使用这一步

 1. install latest node js from https://nodejs.org/en/ 2.Run CMD with "Run as Administrator" 3.npm install -g angular-cli 

它会运行

我通过回滚到早期版本的节点来解决问题

  1. nvm ls(查看安装的节点版本)

  2. nvm使用*。**(select要使用的版本)