在发布 npm 包的时候提示没有登录,解决办法 This command requires you to be logged in to https://npm.pkg.github.com
问题描述
做了一个 npm 包,在想发布的时候,怎么都发布不了。一直提示:
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in to https://npm.pkg.github.com
npm ERR! need auth You need to authorize this machine using `npm adduser`
但是我明明已经登录了
npm adduser 登录成功的
解决办法
registry 末尾不要加斜杠
错误写法
"publishConfig": {
"registry": "https://registry.npmjs.org/"
}
正确写法
"publishConfig": {
"registry": "https://registry.npmjs.org"
}