简体   繁体   English

在Windows问题上安装Express

[英]installing express on windows issues

I am trying to install express framework for node on my Windows system, it always stops with an error: 我正在尝试在Windows系统上为节点安装Express框架,但始终会因错误而停止:

info it worked if it ends with ok 信息,如果一切正常就可以了
verbose cli [ 'C:\\Program Files (x86)\\nodejs\\\\node.exe', 详细cli ['C:\\ Program Files(x86)\\ nodejs \\\\ node.exe',
verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', verbose cli 'install', verbose cli '-g', verbose cli 详细cli'C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ bin \\ npm-cli.js',详细cli'install',详细cli'-g',详细cli
'express' ] info using npm@1.1.0-3 info using node@v0.6.9 verbose config file C:\\Users\\kpatil.npmrc 使用npm@1.1.0-3的'express']信息使用node@v0.6.9的详细配置文件C:\\ Users \\ kpatil.npmrc
verbose config file C:\\Program Files (x86)\\nodejs\\etc\\npmrc 详细的配置文件C:\\ Program Files(x86)\\ nodejs \\ etc \\ npmrc
verbose config file C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\npmrc verbose mkdir done: C:\\Users\\kpatil\\AppData\\Roaming\\npm 755 verbose cache add [ 'express', null ] silly cache add: name, spec, args [ undefined, 'express', [ 'express', null ] ] 详细配置文件C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ npmrc完成详细mkdir:C:\\ Users \\ kpatil \\ AppData \\ Roaming \\ npm 755详细缓存add ['express',null]傻缓存添加:名称,规范,参数[undefined,'express',['express',null]]
verbose parsed url { pathname: 'express', path: 'express', href: 'express' } verbose addNamed [ 'express', '' ] 详细解析的url {pathname:'express',path:'express',href:'express'} verbose addNamed ['express','']
verbose addNamed [ null, '' ] silly name, range, hasData [ 'express', '', false ] verbose raw, before any munging express verbose url resolving [ 'http://registry.npmjs.org/', './express' ] verbose addNamed [null,'']愚蠢的名称,范围,hasData ['express','',false]冗长的原始值,之前有任何冗长的解析冗长url解析['http://registry.npmjs.org/','。 /表达' ]
verbose url resolved http://registry.npmjs.org/express http GET http://registry.npmjs.org/express ERR! 详细网址已解析http://registry.npmjs.org/express http GET http://registry.npmjs.org/express错误! Error: failed to fetch from registry: express ERR! 错误:无法从注册表获取:表达ERR! at C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\lib\\utils\\npm-registry-client\\get.js:139:12 ERR! 在C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ lib \\ utils \\ npm-registry-client \\ get.js:139:12 ERR! at cb (C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\lib\\utils\\npm-registry-client\\request.js:32:9) ERR! 在cb(C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ lib \\ utils \\ npm-registry-client \\ request.js:32:9)ERR! at Request._callback (C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\lib\\utils\\npm-registry-client\\request.js:137:18) ERR! 在Request._callback(C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ lib \\ utils \\ npm-registry-client \\ request.js:137:18)ERR! at Request.callback (C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\request\\main.js:109:22) 在Request.callback(C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ node_modules \\ request \\ main.js:109:22)
ERR! 呃! at Request. 应要求。 (C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\request\\main.js:198:58) (C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ node_modules \\ request \\ main.js:198:58)
ERR! 呃! at Request.emit (events.js:88:20) ERR! 在Request.emit(events.js:88:20)错误! at ClientRequest. 在ClientRequest。 (C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\request\\main.js:195:10) (C:\\ Program Files(x86)\\ nodejs \\ node_modules \\ npm \\ node_modules \\ request \\ main.js:195:10)
ERR! 呃! at ClientRequest.emit (events.js:67:17) ERR! 在ClientRequest.emit(events.js:67:17)错误! at Socket. 在套接字。 (http.js:1134:11) ERR! (http.js:1134:11)错误!
at Socket.emit (events.js:67:17) 在Socket.emit(events.js:67:17)

Any help appreciated... 任何帮助表示赞赏...

Use the advice from Microsoft: 使用Microsoft的建议:

Try npm cache clean first. 首先尝试npm cache clean。

If that doesn't fix things, take a look in %APPDATA%\\npm-cache, 如果仍不能解决问题,请查看%APPDATA%\\ npm-cache,

or if you're using PowerShell, $env:APPDATA\\npm-cache. 或者,如果您使用的是PowerShell,则$ env:APPDATA \\ npm-cache。

If that doesn't work, use the URI template pattern of the registry JSON to do it manually: 如果这不起作用,请使用注册表JSON的URI模板模式手动进行操作:

  • Open https://registry.npmjs.org/express/latest in a browser or text editor 在浏览器或文本编辑器中打开https://registry.npmjs.org/express/latest
  • Search for tgz 搜索tgz
  • Copy that URL 复制该URL
  • Paste it into the location bar in a browser to download it 将其粘贴到浏览器的位置栏中以下载
  • Unpack the file using 7zip 使用7zip解压缩文件
  • Copy the npm files to the same path as node 将npm文件复制到与节点相同的路径

References 参考文献

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM