0

To install some packages globally we can
npm install -g package1 package2
But, now i recently uploaded 2nd app on server and have to install all the packages in package.json but some of them are install previously for 1st app so to save the space on server, I want to save packages globally, so apps can access them and I do not have to install them twice.
My package.json is to large it is hard to install by npm install -g package1 package2 ... this method.

Is there any other method to install all packages in package.json globally?

I have searched but every time i got npm install -g package1 package2

Rajan Lagah
  • 2,373
  • 1
  • 24
  • 40

2 Answers2

1

You can save all the node_modules in a single folder and make this folder accessible from every path inside your server based on your OS. You can also refer custome-location

mehta-rohan
  • 1,373
  • 1
  • 14
  • 19
0

Unfortunately this is not possible and it is unlikely to be possible ever in the future.

Vans
  • 115
  • 1
  • 5