如何从命令行设置.npmrc(构建参数)



我需要配置我的.npmrc,但作为一个构建参数。我发现了如何在官方npm回购中做到这一点:https://stackoverflow.com/a/53714075:

npm config set '//registry.npmjs.org/:_authToken' "${TOKEN}" && npm publish

然而,这是针对Webix的,所以我的.npmrc看起来像这样:

@xbs:registry=http://npm.webix.com/
//npm.webix.com/:_authToken="${TOKEN}"
unsafe-perm=true

有人能帮我吗,我如何将其配置为构建arg?


编辑

现在我在这根绳子上,但它仍然失败了,我想我做错了什么?

npm config set @xbs:registry http://npm.webix.com/ && npm config set "unsafe-perm=true" && npm config set "//npm.webix.com/:_authToken=${TOKEN}" && npm publish

我用这个解决了问题:

npm config set @scope:registry http://registry-url/ && npm config set //token-address "${NPM_AUTH_TOKEN}"

最新更新