【问题标题】:How to pass inline options when running npx?运行 npx 时如何传递内联选项?
【发布时间】:2019-12-25 13:03:55
【问题描述】:

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

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

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

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

【问题讨论】:

    标签: npx npm-registry


    【解决方案1】:

    使用

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

    https://docs.npmjs.com/misc/config

    【讨论】:

      猜你喜欢
      • 2010-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-28
      • 2022-06-22
      • 2021-07-28
      • 2022-01-03
      • 1970-01-01
      相关资源
      最近更新 更多