如何 运行 npx 使用类似于 `--registry https://registry.npmjs.org` 的东西 运行ning npm install 来绕过 artifactory?

How to run npx with something similar to `--registry https://registry.npmjs.org` when running npm install to get around artifactory?

--registry https://registry.npmjs.org 在使用 npm install 安装时被用来绕过类似人工制品的代理,但我想用 npm xxx 做类似的事情,因为我遇到

npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm="Artifactory Realm"

当尝试做 npx create-react-app myapp

这可能吗?

我在网上根本找不到任何关于此的信息!

你可以运行这样的东西:

npm_config_registry=https://registry.npmjs.org npx xxx

这是 npm 团队的suggested。我 运行 遇到了同样的问题,但那是因为我需要让 npx 指向私有注册表。