I am trying to build an application requiring NPM on Open Build Service. When building the application locally, one of the steps is
cd
ing 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:
The first step is npm install --ignore-scripts
, the second is npm rebuild
.