Node.js 使用npm安装时出错(npm错误!Windows\u NT 6.3.9600)
大家好,我在尝试通过npm安装软件包时遇到以下错误。我使用的操作系统是Windows8。它在Ubuntu上运行得非常好。请帮我解决这个问题Node.js 使用npm安装时出错(npm错误!Windows\u NT 6.3.9600),node.js,npm,Node.js,Npm,大家好,我在尝试通过npm安装软件包时遇到以下错误。我使用的操作系统是Windows8。它在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 Fil
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
C:\Users\xxxxx>npm安装-g jshint
npm错误!解析json时发生注册表错误
npm错误!Windows NT 6.3.9600
npm错误!argv“C:\\Program Files\\nodejs\\\node.exe”C:\\Program Files\\node\\node\u modules\\npm\\bin\\npm cli.js”“install”“-g”“jshint”
npm错误!节点v0.12.4
npm错误!npm v2.10.1
npm错误!意外标记<
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!很抱歉,这暂时不可用。
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!
npm错误!如果需要帮助,您可以在以下位置报告此错误:
npm错误!
npm错误!请在任何支持请求中包括以下文件:
npm错误!C:\Users\xxxxx\npm-debug.log
我找到了这个问题的解决方案(至少在我的情况下)。
注册表的url已过期。
请参阅此链接:
谢谢。就我而言,在Windows上升级npm需要手动步骤,以确保PowerShell/CMD找到新版本的npm。这是Microsoft DX工程师制作的一个小工具,用于npm和Node,将过程简化为一个简单的命令。
要查看更多详细信息,我通过回滚到node的早期版本解决了这个问题
1. install latest node js from https://nodejs.org/en/
2.Run CMD with "Run as Administrator"
3.npm install -g angular-cli
它将运行看起来您在同一目录中有一个无效的json.no的
包.json
文件。我在目录中没有package.json。我已经处理好了。但是,我使用-g选项全局安装jshint。