如何解决无法将包裹推到Github
我正在尝试为NPM项目设置Github软件包,但是遇到了一些问题。
我在某个特定的组织下有一个仓库:
my-orgname/my-repo-name
这个仓库是私人的
my-orgname/my-repo-name
存储库中的代码包含一个NPM模块。
项目中的package.json
{
"name": "@my-orgname/my-repo-name","version": "1.0.0","description": ".....","publishConfig": {
"registry": "https://npm.pkg.github.com/"
},"repository": {
"type": "git","url": "https://github.com/my-orgname/my-repo-name"
},.....
.npmrc在项目文件夹中
registry=https://npm.pkg.github.com/my-orgname
〜/ .npmrc文件
//registry.npmjs.org/:_authToken=<TOKEN>
//npm.pkg.github.com/:_authToken=<TOKEN>
在项目文件夹中。
npm publish
结果
npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/@my-orgname%2fmy-repo-name - The expected resource was not found.
npm ERR! 404
npm ERR! 404 '@my-orgname/my-repo-name@1.0.0' is not in the npm 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
npm ERR! 404 tarball,folder,http url,or git url.
解决方法
我遇到了类似的问题,发现我需要给我的 github 个人访问令牌以下权限:
- repo(完全控制私有仓库)
- write:packages(将包上传到 github 包注册表)
- read:packages(从 github 包注册表下载包)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。