Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

node.js

npm

npx

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

like image 483
Ezeewei Avatar asked Feb 24 '20 16:02

Ezeewei


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.

like image 57
fotijr Avatar answered Oct 23 '22 23:10

fotijr