[英]npm install fails with message “Error: socket hang up”
我在執行npm install module-name --save
時遇到了這個問題
無論我安裝什么,它都會失敗。
如果我在package.json
指定它,它將失敗。 然后為整個項目運行npm install
。
也有類似的問題
但不幸的是,它對我不起作用。 另外,我的其他項目也可以npm install
。
我的環境:npm v6.4.1,node.js v10.10.0無服務器v1.28.0
感謝任何形式的幫助。
這是控制台中的日志消息:
> spawn-sync@1.0.15 postinstall /Users/pro/node_modules/spawn-sync
> node postinstall
> serverless@1.28.0 postinstall /Users/pro/node_modules/serverless
> node ./scripts/postinstall.js
Error: socket hang up
at createHangUpError (_http_client.js:322:15)
at TLSSocket.socketOnEnd (_http_client.js:425:23)
at TLSSocket.emit (events.js:187:15)
at TLSSocket.EventEmitter.emit (domain.js:442:20)
at endReadableNT (_stream_readable.js:1092:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm WARN cognito-backend@1.0.0 No description
npm WARN cognito-backend@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serverless@1.28.0 postinstall: `node ./scripts/postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serverless@1.28.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.