What is the recommended way of distributing packages to Node.js servers, running inside a company intranet? The problem is most servers cannot directly access the npm registry. Is it possible to install a private repo, sync it with the official one, and then sync the internal servers from here?
Asked
Active
Viewed 1,123 times
6
-
2Have you looked at [this blog post](https://blog.caurea.org/2012/01/31/local-npm-registry-mirror.html)? – JohnnyHK Nov 13 '12 at 14:02
-
2@JohnnyHK Thanks! Here is another one: http://node-code.com/blog/?p=155 – kol Nov 13 '12 at 14:06
1 Answers
1
Best practice is to check your node_modules into your git repository (remove node_modules from .gitignore). Then, only your developer machines will need access to npm.org, and the servers will get the packages from your internal git repository.
![](../../users/profiles/4099593.webp)
Bhargav Rao
- 41,091
- 27
- 112
- 129
![](../../users/profiles/1935918.webp)
Dan Kohn
- 31,010
- 8
- 77
- 99