Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've got a script that automatically installs some npm packages (specifically karma, which I'd like to install with --global) on an EC2 instance on startup. The problem is that npm sometimes randomly fails, presumably due to network hiccups, though I'm not entirely sure what's going on.

To rule out the network, what I'd like to do is download the relevant files for npm and ask it to install karma based on the files as I download them from S3.

But how do I do that? How do I tell npm not to grab files from the central repository and to instead grab them from somewhere else?

share|improve this question

1 Answer 1

You have to first install npmbox module globally, This module creates an Offline package with all depedencies of given module. Then you could use npmunbox command to install that package to your offline machine.

To install npmbox: npm install -g npmbox

To create offline package of a module: npmbox -v localtunnel, It will generate a localtunnel.npmbox file to current directory. Copy that you your offline machine.

To install offline package: npmunbox localtunnel.npmbox

For more info: https://github.com/arei/npmbox

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.