Chris Snow Chris Snow - 7 months ago 56
Node.js Question

how to determine where npm packages are hosted?

I'm trying to install some npm packages on a machine that has controlled access to the Internet. I can request that the network team grant me access to a remote host/port but I'm not clear which hosts/ports I need to access.

Are all the packages that are installed via npm available via a single host/port? If not, how can I determine the list of hosts/ports that I need access to?

I appreciate that opening access to npm hosts/ports may not be the best approach from a security perspective and that it may be better to download the npm modules on a separate machine that I then upload to my secure host.

Answer Source

There are two standard places for storing npm packages: and You must have access only to them.

Install some packages and create npm-shrinkwrap.json file (using command npm shrinkwrap for npm<5, in npm>5 this file is called package-lock.json and it's automatically generated). Open the created lock file, take a look at resolved field of each package.

the part of npm.shrinkwrap file:

"lodash": {
  "version": "4.17.4",
  "from": "lodash@4.17.4",
  "resolved": ""

"ng-bootstrap-lightbox": {
  "version": "1.0.1",
  "from": "git+",
  "resolved": "git+"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download