小编Ale*_*dre的帖子

纱线添加 - 私人包 - 404 未找到

我想使用 Yarn 安装托管在内部 Gitlab 上的私有包。因此,我.npmrc使用以下信息配置了我的:

@mypackage:registry=https://gitlab.intra/api/v4/packages/npm/
//gitlab.intra/api/v4/projects/819/packages/npm/:_authToken=xxxxx
//gitlab.intra/api/v4/packages/npm/:_authToken=xxxxx
always-auth=true
Run Code Online (Sandbox Code Playgroud)

当我尝试使用安装包时yarn add @mypackage/lib-node-client,Yarn 给我一个错误:

Trace: 
  Error: https://gitlab.intra/api/v4/projects/725/packages/npm/@mypackage/lib-node-common/-/@mypackage/lib-node-common-21.7.1.tgz: Request failed "404 Not Found"
      at ResponseError.ExtendableBuiltin (/usr/lib/node_modules/yarn/lib/cli.js:696:66)
      at new ResponseError (/usr/lib/node_modules/yarn/lib/cli.js:802:124)
      at Request.<anonymous> (/usr/lib/node_modules/yarn/lib/cli.js:67062:16)
      at Request.emit (node:events:369:20)
      at Request.module.exports.Request.onRequestResponse (/usr/lib/node_modules/yarn/lib/cli.js:141640:10)
      at ClientRequest.emit (node:events:369:20)
      at HTTPParser.parserOnIncomingClient (node:_http_client:646:27)
      at HTTPParser.parserOnHeadersComplete (node:_http_common:129:17)
      at HTTPParser.execute (<anonymous>)
      at TLSSocket.socketOnData (node:_http_client:512:22)
Run Code Online (Sandbox Code Playgroud)

所以,Yarn 找不到 URL:https://gitlab.intra/api/v4/projects/725/packages/npm/@mypackage/lib-node-common/-/@mypackage/lib-node-common-21.7.1.tgz

如果我尝试在浏览器上获取此内容,我可以下载该软件包...

如果有人可以帮助我,谢谢大家:)

yarnpkg

13
推荐指数
2
解决办法
4722
查看次数

标签 统计

yarnpkg ×1