0

There is a way to install npm package to a machine which doesn't have internet acccess is, using npm pack in machine with internet acces, copying it to machine without internet and running npm install <tar> in it. But npm pack, packs whole project.

But I want to manage and install the modules myself, without the opportunity for the developers to add/remove any modules. So I just want node_modules to be packaged. And then want to install it to machine without internet.

For example when developer push his/her commits to origin, I want to get node_modules from ftp etc. and codes from GitLab then go on continuous integration with this static node_modules.

How can I do that?

2 Answers2

0

There is a solution to manage the modules yourself: you can store your node_modules in its own repo in which your developers will only be able to clone/get the repo and not contribute/modify it.

Hope this helped you

  • But, do you think storing 250mb file in source control is is true? – CoopTechIn Nov 27 '18 at 16:25
  • I've seen a lot of project in different company done like that. With git you can easily manage your repo to add dependencies and you can manage the right of your collaborator. I think it fits all your needs – Valerian Jaffre Nov 28 '18 at 09:05
0

This can be done, please look at Installing a local module using npm? . You can FTP or whatever to get the packages and install them using npm.

mikeg
  • 444
  • 3
  • 13