pierrec / node-lz4

LZ4 fast compression algorithm for NodeJS
MIT License
436 stars 96 forks source link

Error installing lz4 #119

Open Allen-P12 opened 4 months ago

Allen-P12 commented 4 months ago

I have a react/node.js project I am working on that I want to use the @databricks/sql v1.8.1 module on my machine running windows 10. The lz4 module is a dependency, and I keep running into this error when trying to install either one. I have tried removing the node modules and package-lock, reinstalled node, ran the command in the command prompt and powershell as an admin with no luck.

Any advice?

node version: v20.10.0 npm: v10.2.0

Error when I run "npm install lz4":

PS C:\Users\github> npm install lz4 npm ERR! code 1 npm ERR! path C:\Users\github\node_modules\lz4 npm ERR! command failed npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@10.0.1 npm ERR! gyp info using node@20.10.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.11.0 found at "C:\Program Files\Python311\python.exe" npm ERR! gyp http GET https://nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz npm ERR! gyp WARN install got an error, rolling back install npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: ENOENT: no such file or directory, open 'C:\path\to\your\cert.pem' npm ERR! gyp ERR! System Windows_NT 10.0.19045 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" npm ERR! gyp ERR! cwd C:\Users\github\node_modules\lz4 npm ERR! gyp ERR! node -v v20.10.0 npm ERR! gyp ERR! node-gyp -v v10.0.1 npm ERR! gyp ERR! not ok

kravets-levko commented 4 months ago

Hi @Allen-P12! Looks that node-gyp failed to download Nodejs header files (the URL you can see in logs you shared) - it tries to use a non-existing certificate or something like this. I think it's not related to node-lz4 but rather to your development environment. Please check if you can download those headers from your browser, then try to access that URL using the Nodejs installed on your machine

Allen-P12 commented 4 months ago

Hi @kravets-levko, thank you for the help! It ended up being that .tar.gz files were defaulted to opening using the raspberry pi imager on my machine. Changing the default program to the 7 zip file manager for that file type, deleting the node modules, and re-doing the npm install resolved the issue and lz4 installed correctly.