cnpm install 报错:Connect timeout for 5000ms
cnpm install 报错:Connect timeout for 5000msvue项目执行cnpm install 报入下错误:Get /binary-mirror-config/latest from https://r.npm.taobao.org error: ConnectionTimeoutError: Connect timeout for 5000ms, GET https:
cnpm install 报错:Connect timeout for 5000ms
vue项目执行cnpm install 报入下错误:
Get /binary-mirror-config/latest from https://r.npm.taobao.org error: ConnectionTimeoutError: Connect timeout for 5000ms, GET https://registry.npmjs.com/binary-mirror-config/latest -2 (connected: false, keepalive socket: false, agent status: {“createSocketCount”:4,“createSocketErrorCount”:0,“closeSocketCount”:4,“errorSocketCount”:0,“timeoutSocketCount”:0,“requestCount”:0,“freeSockets”:{},“sockets”:{},“requests”:{}}, socketHandledRequests: 1, socketHandledResponses: 0)
headers: {}
at Timeout._onTimeout (/opt/node/lib/node_modules/cnpm/node_modules/urllib/lib/urllib.js:946:15)
at listOnTimeout (timers.js:327:15)
at processTimers (timers.js:271:5)
Get /bug-versions/latest from https://r.npm.taobao.org error: ConnectionTimeoutError: Connect timeout for 5000ms, GET https://registry.npmjs.com/bug-versions/latest -2 (connected: false, keepalive socket: false, agent status: {“createSocketCount”:8,“createSocketErrorCount”:0,“closeSocketCount”:8,“errorSocketCount”:0,“timeoutSocketCount”:0,“requestCount”:0,“freeSockets”:{},“sockets”:{},“requests”:{}}, socketHandledRequests: 1, socketHandledResponses: 0)
headers: {}
at Timeout._onTimeout (/opt/node/lib/node_modules/cnpm/node_modules/urllib/lib/urllib.js:946:15)
at listOnTimeout (timers.js:327:15)
at processTimers (timers.js:271:5)
Error: Cannot find module ‘bug-versions/package.json’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:613:15)
at Function.Module._load (internal/modules/cjs/loader.js:539:25)
at Module.require (internal/modules/cjs/loader.js:667:17)
at require (internal/modules/cjs/helpers.js:20:18)
at getRemotePackage (/opt/node/lib/node_modules/cnpm/node_modules/npminstall/lib/utils.js:457:11)
at getRemotePackage.throw ()
at onRejected (/opt/node/lib/node_modules/cnpm/node_modules/co/index.js:81:24)
npminstall version: 3.27.0
npminstall args: /opt/node/bin/node /opt/node/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js --fix-bug-versions --china --userconfig=/root/.cnpmrc --disturl=https://npm.taobao.org/mirrors/node --registry=https://r.npm.taobao.org
解决方法:(根据上述的报错文件路径)
vim /opt/node/bin/node /opt/node/lib/node_modules/cnpm/node_modules/npminstall/bin/install.js
#修改之前:
exports.TIMEOUT = ms('5s');
exports.TIMEOUTS = [ms('5s'), ms('5s')];
#修改之后:
exports.TIMEOUT = ms('10s');
exports.TIMEOUTS = [ms('10s'), ms('10s')];
保存之后,重新执行cnpm install
完美解决!!!!!!!!
更多推荐
所有评论(0)