How to install NodeJS project locally without internet connection?

You can install packages on a system without internet connection by packing them using built-in functionality in npm. This way, the node modules will be installed properly.

  1. Create a package.json.
  2. In your package.json, list all the modules you need under bundledDependencies (docs on npm).
  3. Run npm install to install your node files before packing.
  4. Create a tarball with npm pack.
  5. Copy the tarball over to the machine without internet connection.
  6. Install the modules with npm install <filename>.

Update

Regarding your comments, it looks like your globally installed node modules isn’t found.

Try using the npm link command (docs on npm link):

  1. cd yourAppFolder
  2. npm link node-windows

Leave a Comment