Skip to content
Advertisement

Installing node-gyp offline

node-gyp has millions of threads regarding offline installation issues, however, none of the solutions worked for me.
I’m trying to install node-sass-chokidar actually, which depends on node-sass and therefore depends on this package. I’m working on Ubuntu 16.04.
Due to the pc being offline, I cannot put the full log, however, in short:

JavaScript

I’ve manually downloaded the above headers files, but I can’t seem to be able to use them.
I tried to extract the headers and then yarn add node-sass-chokidar --nodedir /path/to/headers, but without success.
I also tried with the exact path of the headers (they are nested inside the downloaded directories inside include/node/....
Another thing I attempted was to put the headers in $HOME/.node-gyp/8.9.4, which failed as well.

I wonder if I need to download the whole node source for the --nodedir path, however, I don’t think its reasonable to do such thing for a minor sass builder library… it just feels crazy.
What am I doing wrong? No matter what I do the library tries to access the internet and fails to use the headers I downloaded.

Advertisement

Answer

Sad truth was that I missed the installVersion file which wasn’t present in the headers download.
Once I extracted the headers to ~/.node-gyp and added an installVersion file containing 9, the installation worked.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement