-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to install the source when there is no network #1154
Comments
Copy over the source tarball from nodejs.org and pass |
Could you write the detailed steps? |
That's really all there is to it. If anything specific is unclear, let me know and I'll try to clarify. |
Are you trying to install If you've installed node and npm you already have Assuming you're using node v6.10.1: Headers are stored in curl -O https://nodejs.org/dist/v6.10.1/node-v6.10.1-headers.tar.gz # on a computer with internet
# Copy header tarball to offline machine
mkdir -p ~/.node-gyp/6.10.1
tar -xf node-v6.10.1-headers.tar.gz --directory ~/.node-gyp/6.10.1/ --strip-components 1
echo 9 >~/.node-gyp/6.10.1/installVersion This should be enough for the common use case, if you need something more specific please provide some actual information about what you want to do. |
Not sure if this is related or not, but I have a dependency (better-sqlite3) that has a compilation step that uses node-gyp to compile. For reasons I don't quite understand, the header files are downloaded when this compilation phase is kicked off for the first time. When this module is compiled, a folder is created at When I run node v8.1.2 |
@bdharrington7 The tarball that node-gyp downloads contains the node.js SDK (this file), it's not related to the tarball that npm downloads from its registry when you install a package. If you download the SDK tarball manually, invoke node-gyp like this from inside the directory that contains the add-on you want to build (with a binding.gyp in it):
|
The issue I'm trying to solve for is that the directory that contains the add-on I want to build doesn't exist at the time I want to install the headers. I'm trying to preemptively provide these headers in the expected location so that when A little more insight on the problem: I'm trying to create a development environment in Docker that works offline. As such, since the |
|
EDIT: lib/configure.js#L77 |
@bdharrington7 did you get past this problem in your docker container? |
Yeah, I download and place the header files like this, but you’ll have to figure out where to get the binary, I’m getting them from an internal repo.
|
How did you do the |
I store my dependencies in source control (the non-compiled ones) so I turn off WiFi and run |
Simpler solution in #1133 (comment):
|
Windows users, beware:
|
Anyone know any alternative solution? |
GYP_TARBALL does not work with Node v18.16.1 and NPM v9.3.1. gyp still tries to download the headers from nodejs.org: |
@pcurrivan did you solved this problem? |
@pcurrivan have you solved this problem? |
@chj-damon i solved my problem using env var - NODEJS_ORG_MIRROR |
@robingood556 can you share how you did it? thanks |
@chj-damon add ENV in my Dockerfile |
|
the target machine(ubuntu 16.04) has no network, how do i install it in source?
The text was updated successfully, but these errors were encountered: