【问题标题】:npm install fails with message "Error: socket hang up"npm install 失败并显示消息“错误:套接字挂起”
【发布时间】:2018-10-25 12:01:41
【问题描述】:

我在执行npm install module-name --save时遇到了这个问题

无论我安装什么,它都会失败。

如果我在 package.json 中指定它,它会失败。然后为整个项目运行npm install

有一些类似的问题张贴像

NPM doesn't install any modules: network socket hangs up

NodeJS - What does "socket hang up" actually mean?

但不幸的是,它对我不起作用。另外,npm install 可以用于我的其他项目。

我的环境:npm v6.4.1,node.js v10.10.0 serverless 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:

【问题讨论】:

    标签: javascript node.js npm serverless-framework serverless


    【解决方案1】:

    我发现了一个解决我的问题的 github 问题:

    https://github.com/maciejtreder/ng-toolkit/issues/448

    使用nvm install v10.6.0

    【讨论】:

      猜你喜欢
      • 2018-09-08
      • 2021-03-20
      • 2022-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多