2

在不更改工作站的全局 npm 配置或在当前目录中创建.npmrc文件的情况下,我想使用私有 nexus 注册表运行 npx 包。

那么,是否可以使用 和 等内联选项运行命令npx(最好是跨平台)?就像是:registrystrict-ssl

npx somerunnablepackage --registry https://mynexus --strict-ssl false

我在 PowerShell/Windows 上尝试了上面的代码片段,但我的注册表没有被命中,它仍然试图访问默认注册表 ( https://registry.npmjs.org )。

4

1 回答 1

-1

利用

npm_config_registry=https://mynexus npm_config_strict_ssl=false npx somerunnablepackage

请参阅https://docs.npmjs.com/misc/config

于 2020-03-25T02:50:40.953 回答