Home > Net >  What are exact destinations in internet that are needed to be opened in order for `npm install` comm
What are exact destinations in internet that are needed to be opened in order for `npm install` comm

Time:03-18

I have searches for internet, but I am not sure: I have installed NodeJS on my machine inside private network. I need npm install command to be working on private network. Security teem is asking me exact destinations in internet that are needed to be opened in order for npm install command to be working.

What are these destinations?

P.S. Ideally I would like all npm commands to be working. What destinations are needed in this case?

Thank you

CodePudding user response:

https://registry.npmjs.org, this is the default registry for all the npm packages but you can change it by configuring ".npmrc" file.

CodePudding user response:

NPM (Node Package Manager) uses by default the public repository https://registry.npmjs.org/ so if you will use public packages as dependencies that's the domain from where it resolves the dependencies to download them. Here is the documentation about NPM: https://docs.npmjs.com/cli/v8/using-npm/registry

Although, your projects could require private packages as dependencies, and those could be stored in private repositories (GPM, Artifactory, etc.). In that scenario you will need to know from where your project is downloading those dependencies.

There are two places where you can see the registry used in your case:

  • .npmrc file located at you user directory with the global configuration.
  • .npmrc file located at the root of your project managed by NPM.
// .npmrc
registry=https://registry.npmjs.org/
  • Related