0

I need to install pm2 and pm2-windows-service package globally on a computer without an internet connection. I have tried to save each package as a tarball on my own computer (with internet connection) like this:

npm pack pm2 
npm pack pm2-windows-startup

Then I copy both tarball files 'pm2-4.2.3.tgz' and 'pm2-windows-startup-1.0.3.tgz' to the computer without internet connection and try to install globally as follow:

npm i -g pm2-4.2.3.tgz
npm i -g pm2-windows-startup-1.0.3.tgz

But I always have the same error ...

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/@pm2%2fagent failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'

Some suggestion to solve that?

asked Mar 7, 2020 at 21:01

1 Answer 1

1

According to npm documentation

Global install (with -g): puts stuff in /usr/local or wherever node is installed.

I haven't tried it myself but what I'd try to do is to take the dependency (with all subdependencies) and put it in the directory with your node. Something like <PATH_TO_NODE>/node_modules.

Then take the corresponding file from your local node_modules/.bin and put it in the <PATH_TO_NODE>

If you don't know where your node is installed, you can run this command in the terminal

npm config get prefix

Directories will be different on UNIX systems.

answered Mar 7, 2020 at 21:11
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.