15

--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!

ey dee ey em
  • 7,991
  • 14
  • 65
  • 121
  • solutions in this answer might hep you https://stackoverflow.com/questions/53657920/i-cant-install-react-using-npx-create-react-app – kitimenpolku Jun 29 '20 at 16:15

1 Answers1

17

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.

fotijr
  • 946
  • 11
  • 20