【问题标题】:How to use multiple npm auth tokens如何使用多个 npm 身份验证令牌
【发布时间】:2020-10-19 08:46:25
【问题描述】:

我需要设置多个 npm 令牌,它们位于两个不同的范围内

@scope1:registry=https://registry.npmjs.org/
@scope2:registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

我已尝试将身份验证令牌添加到每个范围

@scope1:registry=https://registry.npmjs.org/:_authToken=${TOKEN_1}
@scope2:registry=https://registry.npmjs.org/:_authToken=${TOKEN_2}

但是当我尝试安装软件包时,我收到了405

我尝试查找文档:https://docs.npmjs.com/using-npm/config,但我找不到为不同范围指定不同令牌的方法

【问题讨论】:

标签: javascript node.js npm npm-install .npmrc


【解决方案1】:

我联系了 npm 支持并得到以下回复:

用户不能混合和匹配单个注册表的身份验证。我们建议让单个 npm 用户被授予访问所有包的权限并为该用户使用令牌。

【讨论】:

    猜你喜欢
    • 2019-11-24
    • 2019-06-28
    • 1970-01-01
    • 2012-02-07
    • 1970-01-01
    • 2012-12-09
    • 1970-01-01
    • 1970-01-01
    • 2021-08-22
    相关资源
    最近更新 更多