I'm trying to run create-react-app from behind a corporate proxy. We use Artifactory to host our NPM packages. I'm able to install create-react-app using the command npm install -g create-react-app -reg <path\to\artifactory>. However when I try to run the create-react-app I get an error that none of the packages can be found in NPM, an error I commonly get when we haven't imported some NPM package to our Artifactory instance yet.
How can I run create-react-app and specify that it should download all packages from our local Artifactory?
You could set it globally for your user (at least until everything gets installed) by running npm config set registry <path/to/artifactory>, run create-react-app, then npm config delete registry if you want to revert the settings. After your create-react-app has finished installing everything, you can create a .npmrc file local to your project with the following contents:
registry=<path/to/artifactory>
Then whenever you install new packages, it will use your artifactory instance.
I believe this was answered!
Most helpful comment
You could set it globally for your user (at least until everything gets installed) by running
npm config set registry <path/to/artifactory>, runcreate-react-app, thennpm config delete registryif you want to revert the settings. After your create-react-app has finished installing everything, you can create a.npmrcfile local to your project with the following contents:Then whenever you install new packages, it will use your artifactory instance.