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

Viewed 3648

--registry https://registry.npmjs.org is been used to get around artifactory alike proxy when install with npm install But I want to do similiar thing with npm xxx because I encounter

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

when try to do npx create-react-app myapp

Is that something possible?

I literarily can't find any info about this online!

1 Answers

You can run something like:

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

This is suggested by the npm team. I ran into this same problem, but that was because I needed to have npx point to a private registry.

Related