.NPMRC无法替换配置中的ENV

发布于 2025-01-18 12:55:44 字数 631 浏览 4 评论 0原文

我和我的同事遇到了 .npmrc 问题

我们大多数人都使用 Mac OSx,这有效

@REGISTRY_NANME:registry=https://gitlab.com/api/v4/packages/npm/ //gitlab.com/ api/v4/packages/npm/:_authToken=${NPM_TOKEN}

但对我来说它不起作用,但是没有像下面这样的 {} ,它为我工作 @REGISTRY_NANME:registry=https://gitlab.com/api/v4/packages/npm/ //gitlab.com/api/v4/packages/npm/:_authToken=$NPM_TOKEN

可能会导致什么那?我怎么能有和同事一样的行为呢?

我尝试使用 zsh 和 .zhsrc,也尝试使用 bash 和 .bash_profile。

我尝试使用npm和yarn

使用带引号和不带引号的export NPM_TOKEN=""

尝试删除.npmrc中的{}

尝试使用.yarnrc文件

谢谢感谢您的帮助!

Me and my colleagues have a problem with .npmrc

Most of us are on Mac OSx and this works

@REGISTRY_NANME:registry=https://gitlab.com/api/v4/packages/npm/ //gitlab.com/api/v4/packages/npm/:_authToken=${NPM_TOKEN}

But for me it don't work, but without {} like below, it works for me
@REGISTRY_NANME:registry=https://gitlab.com/api/v4/packages/npm/ //gitlab.com/api/v4/packages/npm/:_authToken=$NPM_TOKEN

What could cause that? How can I have the same behaviour than my colleagues?

I tried with zsh and .zhsrc, with bash and .bash_profile too.

I tried with npm and yarn

Using quoted and unquoted export NPM_TOKEN="<token>"

Tried to remove the {} in my .npmrc

Tried with a .yarnrc file

Thank you for your help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文