Skip to content
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

Change node-gyp path to download nodejs headers from msnodesqlv8 installation #286

Open
eretztzvi opened this issue May 22, 2023 · 2 comments

Comments

@eretztzvi
Copy link

eretztzvi commented May 22, 2023

I’m working at a company that blocks nodejs.org because of security concerns,
When I run npm i msnodesqlv8 on docker, by default the node-gyp will try to reach nodejs.org to download some headers,
After some research I made I found that If I install node-gyp by itself I can control the default path it tries to reach,
But I can’t have the same effect when I install msnodesqlv8,
Is there a way to change this default path when installing msnodesqlv8?

Error for example:
gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.12.1/node-v18.12.1-headers.tar.gz failed, reason: unable to get local issuer certificate

The goal is to change somehow the path to one I want

@TimelordUK
Copy link
Owner

well its trying to download header files as it wants to build the driver meaning you would need the compiler and header files - this is because when installing the driver, it will try and go to git release page and fetch the binary and place it in the build/release folder.

Is it the case behind a proxy you can also not fetch the binary in this way. In which case perhaps you can manually place binary in the prerelease cache folder so it is installed. For example if you

make sure you had

/home/me/.npm/_prebuilds/9a8c05-msnodesqlv8-v3.1.0-node-v115-linux-x64.tar.gz

downloaded (or version you are trying to install)

then it will simply copy in this cahed version

there is a way to tell node-gyp to chnge the URL but you would have to look at node-gyp documention this has nothing to do with the driver, it will try to compile it if it cannot get the binary as shown

 msnodesqlv8@3.1.0 install-verbose
> prebuild-install --verbose || node-gyp rebuild

prebuild-install info begin Prebuild-install version 7.1.1
prebuild-install info looking for local prebuild @ prebuilds/msnodesqlv8-v3.1.0-node-v115-linux-x64.tar.gz
prebuild-install info looking for cached prebuild @ /home/me/.npm/_prebuilds/9a8c05-msnodesqlv8-v3.1.0-node-v115-linux-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ /home/me/.npm/_prebuilds/9a8c05-msnodesqlv8-v3.1.0-node-v115-linux-x64.tar.gz
prebuild-install info unpack resolved to /home/me/dev/js/sql/v8/node_modules/msnodesqlv8/build/Release/sqlserverv8.node
prebuild-install info unpack required /home/me/dev/js/sql/v8/node_modules/msnodesqlv8/build/Release/sqlserverv8.node successfully
prebuild-install info install Successfully installed prebuilt binary!

@TimelordUK
Copy link
Owner

TimelordUK commented May 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants