1

I am trying to do an NPM build, install and bundle on a server which does not have a network connection

I can run the build successfully on an online server, and I can copy the directories which are required over to the offline server

How can I reproduce the NPM environment on the offline server so that an an NPM build, install and bundle will be successful?

I assume I should be copying the node_modules and package-lock.json and running an npm install --offline.

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Alan Kavanagh
  • 9,425
  • 7
  • 41
  • 65

1 Answers1

1

I can run the build successfully on an online server, and I can copy the directories which are required over to the offline server

Knowing that, on a system that has access to the internet, run npm install to create and populate the node_modules directory with all the dependencies.

Copy over the entire application directory including node_modules directory, allowing all dependencies available to the offline server.

This is the approach shared in comments: How to install npm package while offline?

If the dependencies need to be updated, these steps would need to be repeated.

Manny
  • 369
  • 2
  • 7