这听起来像是一个重复的问题,但相信我,事实并非如此。我找不到任何详细说明相同错误以及如何纠正它的来源:

C:\Users\admin\Desktop\nodejsfiles>npm install formidable
npm http GET https://registry.npmjs.org/formidable

npm ERR! Error: failed to fetch from registry: formidable
npm ERR!     at C:\Program Files\nodejs\node_modules\npm\lib\utils\npm-registry-
client\get.js:139:12
npm ERR!     at cb (C:\Program Files\nodejs\node_modules\npm\lib\utils\npm-regis
try-client\request.js:32:9)
npm ERR!     at Request._callback (C:\Program Files\nodejs\node_modules\npm\lib\
utils\npm-registry-client\request.js:137:18)
npm ERR!     at Request.callback (C:\Program Files\nodejs\node_modules\npm\node_
modules\request\main.js:109:22)
npm ERR!     at Request.<anonymous> (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\main.js:198:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\
npm\node_modules\request\main.js:356:14)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1258:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>
npm ERR!
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "formidable"
npm ERR! cwd C:\Users\admin\Desktop\nodejsfiles
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.0-3
npm ERR! message failed to fetch from registry: formidable
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\admin\Desktop\nodejsfiles\npm-debug.log
npm not ok

最佳答案

似乎这有效

npm config set registry http://registry.npmjs.org/

引用自 "message failed to fetch from registry" while trying to install any module

无论如何,我建议更新到最新版本的 nodejsnpm

关于javascript - 无法在 Node js 中安装强大的,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23440898/

10-12 02:24