0

I am trying to build an application requiring NPM on Open Build Service. When building the application locally, one of the steps is cding into a directory containing package.lock and then running npm install.

For obvious reasons this fails on a computer with no internet access.

What I would like is to download the required node modules somehow and then add them as part of the application source.

If node_modules included only text files, I could just tar it up and unpack it on the remote server. Unfortunately, some of the modules include binaries which are built by NPM using g++, and I don't want to include opaque binaries as a “source”.

How can I split npm install into two steps:

  1. to be performed locally and producing human-readable source
  2. to be performed by OBS using downloaded sources and not requiring internet access?
kinokijuf
  • 968
  • 1
  • 11
  • 33

1 Answers1

0

The first step is npm install --ignore-scripts, the second is npm rebuild.

kinokijuf
  • 968
  • 1
  • 11
  • 33