【发布时间】:2021-02-27 01:25:26
【问题描述】:
我有一个 GitHub 帐户,其中包含我的 昵称 作为名为 fraybabak 的用户名。 在 npm 中,我有一个名为我的 babakabadkheir 的用户名。所以我正在尝试将我的第一个包发布到 npm 。
在我的 package.json 文件中我有这个:
"bugs": {
"url": "https://github.com/fraybabak/smart_random/issues"
},
"repository":{
"url":"https://github.com/fraybabak/smart_random.git"
},
"publishConfig": { "registry": "https://npm.pkg.github.com/" },
"homepage": "https://github.com/fraybabak/smart_random#readme"
我知道我的用户名和范围不同。 我尝试使用以下方式登录:
npm login --registry=https://npm.pkg.github.com
并在密码字段中使用 access_token 向 GitHub 进行身份验证。
登录成功
所以现在当我尝试发布时:
npm publish
我收到此错误:
npm ERR! code E400
npm ERR! 400 Bad Request - PUT https://npm.pkg.github.com/@babakabadkheir%2fsmart_random - scope 'babakabadkheir' in package name '@babakabadkheir/smart_random' does not match repo owner 'fraybabak' in repository element in package.json
npm ERR! A complete log of this run can be found in:
npm ERR! /home/babyjesus/.npm/_logs/2020-11-15T17_41_09_392Z-debug.log
【问题讨论】:
标签: node.js github npm package.json