【问题标题】:Npm publish returns write EPIPE Error in GCPNpm 发布在 GCP 中返回写入 EPIPE 错误
【发布时间】:2021-08-10 09:48:05
【问题描述】:

我正在尝试将 NodeJS 包发布到 GCP 中的私有存储库,使用此快速入门配置 .npmrc 文件和身份验证:https://cloud.google.com/artifact-registry/docs/nodejs/quickstart,当我尝试通过命令行发布它时,它返回错误:

verbose stack FetchError: request to https://myurl-gcp/myproject/myrepo/@scope%2fmypackage failed, reason: write EPIPE
verbose stack     at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:110:14)
verbose stack     at ClientRequest.emit (node:events:378:20)
verbose stack     at TLSSocket.socketErrorListener (node:_http_client:462:9)
verbose stack     at TLSSocket.emit (node:events:378:20)
verbose stack     at emitErrorNT (node:internal/streams/destroy:188:8)
verbose stack     at emitErrorCloseNT (node:internal/streams/destroy:153:3)
verbose stack     at processTicksAndRejections (node:internal/process/task_queues:81:21)

如果我尝试打包项目,它可以工作,如果我在另一个项目中使用它作为导入模块,它也可以工作。

版本 NPM:7.20.5 版本节点:15.11.0

任何疑问为什么会发生?

【问题讨论】:

  • 你试过npm login吗?

标签: npm google-cloud-platform repository publish artifact


【解决方案1】:

已解决!

我在包的package.json 中缺少files 属性。

我也遇到了问题,因为我使用的是公司代理,并且包有大约 20 MB,所以删除捆绑的依赖项也可以工作!

【讨论】:

    猜你喜欢
    • 2016-04-25
    • 2015-08-17
    • 2020-12-04
    • 2014-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多