Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to store npm modules in node project source control

Ok I have a little bit of a weird situation. I have a node application that is going to be delivered to systems that do not have access to the internet. I have all my deps in my package.json file, but when I deliver the server I cannot run npm install.

Currently the node_modules directory is being checked into SVN. So far I hate this because every time I need to get a newer version of a module I have delete the entire module from SVN, install the newer version, add it to SVN and checkin.

Other option I have about is have some sort of build that does the npm install when packaging up the node application for delivery. Maybe something that checks out from SVN, does the npm install and creates the necessary tarball or rpm.

I have used 'bundler' for ruby in the past and that is pretty nice as you just put all you deps in another dir and it will pull in those deps. Works great if you are offline. Anything like that for node?

like image 475
lostintranslation Avatar asked Mar 25 '23 05:03

lostintranslation


1 Answers

While looking for similar answer I've found this article about why there is some sense to keep your full node_modules in source control:

node_modules in git

Although it is from December 10 2011, so may be a bit out dated in nowadays.

Update: at January 2014, the advice to store all your node_modules in source control still apply.

like image 148
Sevenate Avatar answered Apr 01 '23 07:04

Sevenate