我正在尝试将一个软件包发布到Gitlab软件包注册表,但它一直报错说
这是我的
当我运行
404 @my-scope/<package-name> is not in this registry
。
最初我按照官方文档的说明进行操作。这是我的
.npmrc
文件内容:@my-scope:registry=https://gitlab.com/api/v4/projects/<project_id>/packages/npm/
//gitlab.com/api/v4/projects/<project_id>/packages/npm/:_authToken=${TOKEN}
同时,我已将publishConfig
添加到package.json
中。
"publishConfig": {
"@my-scope:registry": "https://gitlab.com/api/v4/projects/<project_id>/packages/npm/"
},
当我运行
npm publish
时,我一直收到以下的404错误。npm notice Publishing to https://gitlab.com/api/v4/projects/<project_id>/packages/npm/
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://gitlab.com/api/v4/projects/<project_id>/packages/npm/@my-scope%2fpackage-name
npm ERR! 404
npm ERR! 404 '@my-scope/package-name@1.5.0' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a