我尝试在升级到node v18
和npm v9
后在软件包上运行npm publish
。
但我得到了以下错误:
您需要使用npm adduser
* 授权此计算机
我的用户.npmrc
文件:
//some-package.com:48082/nexus/repository/:keyfile=/Users/<host>/Documents/Certificates/npm.key.pem.
//some-package.com:48082/nexus/repository/:certfile=/Users/<host>/Documents/Certificates/npm.crt.pem
//registry.npmjs.org/:_authToken=<auth_token>
我的项目.npmrc
文件:
@fortawesome:registry=https://npm.fontawesome.com/.
@scope1:registry=https://some-package.com:48082/nexus/repository/path1/
@scope2:registry=https://some-package.com:48082/nexus/repository/path2/
//npm.fontawesome.com/:_authToken=<auth_token>
//some-package.com:48082/nexus/repository/:_auth=<auth>
strict-ssl=false
2条答案
按热度按时间6ss1mwsb1#
要将软件包发布到NPM,您需要登录到NPM注册表。以下是几个步骤-
登录NPM
构建和发布
nx7onnlm2#
此问题的修复方法是,我们需要在存储库级别(而不是nexus级别)的
global .npmrc
中添加证书和密钥文件:对于
project .npmrc
也是如此: