node-sqlserver-v8
node-sqlserver-v8 copied to clipboard
Change node-gyp path to download nodejs headers from msnodesqlv8 installation
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
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
[email protected] 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!
go to https://github.com/TimelordUK/node-sqlserver-v8/releases
look for
[image: image.png]
you would have to find out exactly what file name is being used by pre release install and rename the file to that file name.
On Mon, 22 May 2023 at 10:13, Amir Eretz Tzvi @.***> wrote:
Where can I get 9a8c05-msnodesqlv8-v3.1.0-node-v115-linux-x64.tar.gz from?
— Reply to this email directly, view it on GitHub https://github.com/TimelordUK/node-sqlserver-v8/issues/286#issuecomment-1556851679, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXWJG3CBV5SEN2DOQYLRRTXHMU4HANCNFSM6AAAAAAYJ7AIJQ . You are receiving this because you commented.Message ID: @.***>