Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

danielflower/internal-npm-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Internal NPM Server

This application allows you to run a local NPM server behind a firewall. It downloads modules from the central NPM registry on demand and caches them on your filesystem.

Why use an internal NPM server?

  • You are behind a corporate firewall and want developers to be able to access NPM modules without having them configure proxy settings.
  • The remote NPM server is too slow for your liking.
  • You need to work offline sometimes.

Limitations

  • You cannot publish artifacts to your internal server. In fact, using this breaks npm publish.
  • Any dependencies pointing to GitHub or git repos will not be changed. Only use modules hosted in the official NPM registry if that's a problem.
  • This application has not been stress tested.

Installation

Download

Download the .zip or .tar.gz from the releases page.

Install the server

This is a Java application, so you just need Java 6 or later to run.

Extract the server to a new directory. Edit config.properties to set the hostname of your computer, the port to run on, and the location to keep the cached NPM files in. If behind a proxy, you can set your proxy settings too.

Windows: run.bat will run it as a console app. Ctrl+C to stop it. There is no windows service version currently. Linux: start.sh will start it in the background. Run stop.sh to stop it.

Configure NPM on your development machines

To start using, install the server somewhere, then update your local NPM settings:

npm config set registry "http://your.internal.server:9100/npm/"

Reverting to original NPM repository

Want to stop using the internal NPM server? Just point your NPM back to the original NPM server:

npm config set registry "https://registry.npmjs.org/"

Building from source

This is a Java project using Maven 3. Just clone the repo and run mvn package

About

A java-based NPM server that caches NPM modules on the file system and proxies out to the public repository when needed

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors