mapbox/node-pre-gyp

node-pre-gyp install --fallback-to-build

cvartan opened this issue ยท 119 comments

When installing sqlite3, npm fails on node-pre-gyp with error:

node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Windows_NT 10.0.17763
node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\UserName\node_modules\sqlite3\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\UserName\node_modules\sqlite3
node-pre-gyp ERR! node -v v10.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in node-pre-gyp

I have a similar error when installing pprof:

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp ERR! Completion callback never invoked! 
node-pre-gyp ERR! System Linux 4.19.37-5+deb10u1rodete2-amd64
node-pre-gyp ERR! command "/usr/local/google/home/nolanmar/.nvm/versions/node/v10.16.3/bin/node" "/usr/local/google/home/nolanmar/tmp/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/google/home/nolanmar/tmp/node_modules/pprof
node-pre-gyp ERR! node -v v10.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>

I get a the same error (with a different Node.js version) when using node v8.15.1.

I see this both on my local linux workstation and running in a Google Compute Engine VM.

The binaries for pprof are kept in a publicly readable Google Cloud Storage bucket.

I have the same issue

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Linux 4.15.0-64-generic
node-pre-gyp ERR! command /.nvm/versions/node/v8.10.0/bin/node" "/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /node_modules/sqlite3
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in node-pre-gyp

I have the same issue ๐Ÿ˜ญ. The problem started today and I have not changed any version

node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Linux 4.9.184-linuxkit
node-pre-gyp ERR! command "/usr/local/bin/node" "/srv/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /srv/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.16.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm WARN osa-andes@1.0.0 No description
npm WARN osa-andes@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

not ideal but a workaround is to manually add "node-pre-gyp": "0.12.0" as a devDev to your package.json

Same issue as of ~an hour ago installing a previously working version of https://github.com/IronCoreLabs/ironhide:

> node-pre-gyp install

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp ERR! Completion callback never invoked! 
node-pre-gyp ERR! System Linux 4.4.0-101-generic
node-pre-gyp ERR! command "/home/travis/.nvm/versions/node/v12.10.0/bin/node" "/home/travis/.nvm/versions/node/v12.10.0/lib/node_modules/@ironcorelabs/ironhide/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /home/travis/.nvm/versions/node/v12.10.0/lib/node_modules/@ironcorelabs/ironhide/node_modules/@ironcorelabs/recrypt-node-binding
node-pre-gyp ERR! node -v v12.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>

EDIT: Followed the dependencies to the source package that breaks in this case and got slightly more info in the error

~/.nvm/versions/node/v12.10.0/lib/node_modules/@ironcorelabs/ironhide/node_modules/@ironcorelabs/recrypt-node-binding$ /home/travis/.nvm/versions/node/v12.10.0/lib/node_modules/@ironcorelabs/ironhide/node_modules/.bin/node-pre-gyp install
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.13.0
node-pre-gyp info using node@12.10.0 | linux | x64
node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp info check checked for "/home/travis/.nvm/versions/node/v12.10.0/lib/node_modules/@ironcorelabs/ironhide/node_modules/@ironcorelabs/recrypt-node-binding/bin-package/index.node" (not found)
node-pre-gyp http GET https://github.com/IronCoreLabs/recrypt-node-binding/releases/download/0.5.1/index-v0.5.1-node-v72-linux-x64.tar.gz
node-pre-gyp http 302 https://github.com/IronCoreLabs/recrypt-node-binding/releases/download/0.5.1/index-v0.5.1-node-v72-linux-x64.tar.gz
node-pre-gyp http 200 https://github.com/IronCoreLabs/recrypt-node-binding/releases/download/0.5.1/index-v0.5.1-node-v72-linux-x64.tar.gz
node-pre-gyp info install unpacking bin-package/index.node
node-pre-gyp ERR! Completion callback never invoked! 
node-pre-gyp ERR! System Linux 4.4.0-101-generic
node-pre-gyp ERR! command "/home/travis/.nvm/versions/node/v12.10.0/bin/node" "/home/travis/.nvm/versions/node/v12.10.0/lib/node_modules/@ironcorelabs/ironhide/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /home/travis/.nvm/versions/node/v12.10.0/lib/node_modules/@ironcorelabs/ironhide/node_modules/@ironcorelabs/recrypt-node-binding
node-pre-gyp ERR! node -v v12.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.

Looking in the binary.module_path the correct binary is there. So the download is still working correctly, something really does seem to just being going wrong with the success callback itself?


EDIT2: continued fiddling with the source locally

The tar.extract() call in lib/install.js doesn't call either the error or close pipe event listeners and must time out or something leading to the bin exit handler about the callback getting called. I tried adding an onwarn option, which doesn't get called. Tried adding a finish event handler, which also didn't get called. Everything still works on my local Linux box and worked yesterday with all the same code on the Travis image where I'm debugging. Still haven't found what changed that caused this to start failing.

Same, about an hour ago docker builds started failing.

`Step 10/12 : RUN npm install --ignore-engines
---> Running in 56007d3f1ead

canvas@2.6.0 install /var/www/html/node_modules/canvas
node-pre-gyp install --fallback-to-build
node-pre-gyp
WARN Using needle for node-pre-gyp https download
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Linux 4.4.0-1060-aws
node-pre-gyp ERR! command "/usr/local/bin/node" "/var/www/html/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /var/www/html/node_modules/canvas
node-pre-gyp ERR! node -v v12.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in node-pre-gyp.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR! https://github.com/mapbox/node-pre-gyp/issues`

If that helps.

Same

MacBook-Pro-Admin:PlayGround admin$ npm install bcrypt --save

bcrypt@3.0.6 install /Users/admin/WebstormProjects/PlayGround/node_modules/bcrypt
node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/12.9.0/bin/node" "/Users/admin/WebstormProjects/PlayGround/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/admin/WebstormProjects/PlayGround/node_modules/bcrypt
node-pre-gyp ERR! node -v v12.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! This is a bug in node-pre-gyp.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR! https://github.com/mapbox/node-pre-gyp/issues
npm WARN PlayGround No description
npm WARN PlayGround No repository field.
npm WARN PlayGround No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! bcrypt@3.0.6 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the bcrypt@3.0.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2019-09-23T18_31_40_158Z-debug.log

Same, local run as well as GitHub actions CI is failing on this step.

node-pre-gyp WARN Using request for node-pre-gyp https download
[fsevents] Success: "/Users/ishaantaylor/git/voxer/node_modules/@parcel/watcher/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is installed via remote

> deasync@0.1.15 install /Users/ishaantaylor/git/voxer/node_modules/deasync
> node ./build.js

`darwin-x64-node-10` exists; testing
Binary is fine; exiting

> bcrypt@3.0.6 install /Users/ishaantaylor/git/voxer/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

(node:39550) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added. Use emitter.setMaxListeners() to increase limit
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Darwin 18.2.0
node-pre-gyp ERR! command "/Users/ishaantaylor/.nvm/versions/node/v10.15.3/bin/node" "/Users/ishaantaylor/git/voxer/node_modules/bcrypt/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/ishaantaylor/git/voxer/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.15.3
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm WARN acorn-jsx@5.0.2 requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! bcrypt@3.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the bcrypt@3.0.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I managed to skip the bcrypt error by adding this before installing the package.json

npm --build-from-source install bcrypt

Same here on iMac

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.13.0
node-pre-gyp info using node@10.16.3 | darwin | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/Users/twoweb/Documents/RNApps/geolife-app/node_modules/realm/compiled/node-v64_darwin_x64/realm.node" (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/3.0.0/realm-v3.0.0-node-v64-darwin-x64.tar.gz
node-pre-gyp http 200 https://static.realm.io/node-pre-gyp/3.0.0/realm-v3.0.0-node-v64-darwin-x64.tar.gz
node-pre-gyp info install unpacking node-v64_darwin_x64/realm.node
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/twoweb/Documents/RNApps/geolife-app/node_modules/realm/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/twoweb/Documents/RNApps/geolife-app/node_modules/realm
node-pre-gyp ERR! node -v v10.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! This is a bug in node-pre-gyp.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not he

Same error in linux

/projects/project/repository
`-- node-pre-gyp@0.12.0

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /sane/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /nodemon/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm ERR! Linux 5.0.0-29-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! libxmljs@0.18.8 install: node-pre-gyp install --fallback-to-build --loglevel http
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the libxmljs@0.18.8 install script 'node-pre-gyp install --fallback-to-build --loglevel http'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build --loglevel http
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! npm-debug.log

Please suggest

Anyone able to solved it out anyhow ?

try using build from source like this as gmunozc first mentioned
npm --build-from-source install bcrypt

I'm guessing their server is down

try using build from source like this as gmunozc first mentioned
npm --build-from-source install bcrypt

I'm guessing their server is down

the deployments returned ๐Ÿ˜Ž

Using npm --build-from-source install works for all dependencies except sharp lovell/sharp#1882

d2lam commented

We are having the same issue.
Tried node-pre-gyp@0.12.0 like @markwolff suggested but didn't work.
npm install --build-from-source also didn't work for us.

I think you need to install like this npm install [YOUR_PACKAGE_NAME] --build-from-source and install the specific package that is breaking your install. In my case it works on bcrypt but does not work on canvas.

Guess i'm calling it a day

npm --build-from-source install bcrypt@3.0.6 works for me as a workaround. I'm calling manually from a postinstall script and just removed it from the dependancies for now.

Same error in linux

/projects/project/repository
`-- node-pre-gyp@0.12.0

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /sane/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm WARN optional Skipping failed optional dependency /nodemon/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.9
npm ERR! Linux 5.0.0-29-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! libxmljs@0.18.8 install: node-pre-gyp install --fallback-to-build --loglevel http
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the libxmljs@0.18.8 install script 'node-pre-gyp install --fallback-to-build --loglevel http'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the libxmljs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build --loglevel http
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! npm-debug.log

Please suggest

How Can i fix this issue ?

Looking through dependency changes, only recent change (recent hours) is https://www.npmjs.com/package/aws-sdk/v/2.534.0

Just so everyone knows. There is one "potential" workaround.

Using npm install --build-from-source as your command instead of just npm install.

This will not work with all setups since some configurations (like canvas) have it's own pre-built dependencies it relies on. The problem is that either a server is down or a service is messed up where it can't pull the pre-built stuff. For some, the only thing you can do is wait. With as many people as there are that are having a problem, I would assume it would be fixed soon.

canvas is my exact use case

It actually looks like it might be a change to the aws-sdk, a dependency of node-pre-gyp. 1275 additions, 768 deletions in their commit almost 2 hours ago with a failed commit last Friday. Someone at Amazon is running around like a headless chicken at the moment, lol.

I think there is a good chance this is related to the newest update to Xcode. That is the last thing I did to my dev environment between this working and not working is upgrade to the version that supports iOS 13.

I think there is a good chance this is related to the newest update to Xcode.

Unrelated, issue is cross-platform. Original report was about Windows (node.exe) and we have replicated on both Mac and Linux.

Unrelated, issue is cross-platform. Original report was about Windows (node.exe) and we have replicated on both Mac and Linux.

You are correct. Removed my misleading comment there. Thanks!

Could restricting the dependency help?

Looking at the source I don't think the AWS SDK is involved in the current error. It's only being required in a few specific places, none of which seem to be touched by any of the code paths that people are posting about. I don't have a better suggestion for what has changed yet, but I also don't see how it's AWS. Can't rule it out completely though I guess ๐Ÿคทโ€โ™‚๏ธ.

Please see lovell/sharp#1882 (comment) for an explanation and, for yarn users, a possible workaround.

Confirming @lovell's workaround worked for me on Windows 10 using yarn, only needed to add the resolution to my end project. Thanks a ton!

@gmunozc I'm confirm

npm install --build-from-source

Solve the issue for me inside Docker from node:10

We are running a private npm registry server, but we are also experiencing this issue. I wonder why this is happening to us too. I would have expected the private npm registry to have the older version cached.

I can confirm that running this worked:

npm install sqlite3@4.0.6 --build-from-source && npm install

Please see lovell/sharp#1882 (comment) for an explanation and, for yarn users, a possible workaround.

Confirming this worked for me on OSX using yarn.

Same issue for me here too

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp ERR! Completion callback never invoked!

After this, It just stops installing and crashes the install
Tried this on latest version of NodeJS 12 and on LTS 10.

Trying to install canvas 2.6.0

@charliekump-wf @kawaaii I managed to find a workaround for canvas
npm install canvas --build-from-source && npm install

If you have errors when installing canvas, use brew to install missing stuff and edit $PKG_CONFIG_PATH

I had to do all these to get things working

brew install jpeg;
brew install libffi;
brew install cairo;
brew install pango;
brew install pixman;
// here are my env vars 
echo $PKG_CONFIG_PATH$
/usr/local/cellar/libffi/3.2.1/lib/pkgconfig

@charliekump-wf @kawaaii I managed to find a workaround for canvas
npm install canvas --build-from-source && npm install

If you have errors when installing canvas, use brew to install missing stuff and edit $PKG_CONFIG_PATH

I had to do all these to get things working

brew install jpeg;
brew install libffi;
brew install cairo;
brew install pango;
brew install pixman;
// here are my env vars 
echo $PKG_CONFIG_PATH$
/usr/local/cellar/libffi/3.2.1/lib/pkgconfig

I'm coming from Windows 10, not Linux!
Also from source I also tried and also does not work for me!

Yep. AWS Pipeline started failing today when pushing to the beanstalk instance. Failed when installing bcrypt.

EDIT:
I was able to fix the pipeline by including the package-lock.json file in the build. It wasn't in there previously.

node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp ERR! Completion callback never invoked! 
node-pre-gyp ERR! System Linux 4.14.138-89.102.amzn1.x86_64
node-pre-gyp ERR! command "/opt/elasticbeanstalk/node-install/node-v10.15.1-linux-x64/bin/node" "/tmp/deployment/application/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /tmp/deployment/application/node_modules/bcrypt
node-pre-gyp ERR! node -v v10.15.1
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! bcrypt@3.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the bcrypt@3.0.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.```

I was having an issue when installing bcrypt@3. Went with bcrypt@2 and it worked.

I was having an issue when installing bcrypt@3. Went with bcrypt@2 and it worked.

I had to downgrade too. Thus bcrypt@2.0.1 works on Angular 8 project.

If you use "sharp", put these statement into package.json. It will fix this issue.
"dependencies": {
"minipass": "2.7.0",
"sharp": "^0.23.0"
}

0xASK commented

We're also seeing this issue as of today on both our local setups (OS X) and our Linux deployments which is blocking all progress in our CI/CD pipeline until we figure out a solution

Same here on iMac

node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.13.0
node-pre-gyp info using node@10.16.3 | darwin | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/Users/twoweb/Documents/RNApps/geolife-app/node_modules/realm/compiled/node-v64_darwin_x64/realm.node" (not found)
node-pre-gyp http GET https://static.realm.io/node-pre-gyp/3.0.0/realm-v3.0.0-node-v64-darwin-x64.tar.gz
node-pre-gyp http 200 https://static.realm.io/node-pre-gyp/3.0.0/realm-v3.0.0-node-v64-darwin-x64.tar.gz
node-pre-gyp info install unpacking node-v64_darwin_x64/realm.node
node-pre-gyp ERR! Completion callback never invoked!
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/twoweb/Documents/RNApps/geolife-app/node_modules/realm/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/twoweb/Documents/RNApps/geolife-app/node_modules/realm
node-pre-gyp ERR! node -v v10.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! This is a bug in node-pre-gyp.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not he

me too, How to fix ?

Even if we don't depends directly on sharp or minipass, adding the following dependency to our package.json and cleaning our node_modules fix our CI

"minipass": "2.7.0"

Can probably be explained by lovell/sharp#1882 (comment) as @lovell said.

@Alabate As the man saved the day here mentioned, found a reference here: isaacs/minipass#9

not ideal but a workaround is to manually add "node-pre-gyp": "0.12.0" as a devDev to your package.json

This works for me as well.
Versions 0.10.x are working too, the problem must be with the 0.12

Has seen in #478

npm --build-from-source install bcrypt

fixes my builds on CI

Many thanks @gmunozc

npm i node-pre-gyp@0.10.3

before npm install

Solve the issue for me inside Docker

My builds are working once again with no additional workarounds in place. Thanks everyone, for the magic you foster just underneath the surface... without you I wouldn't have a job!

I'm running MacOS Mojave and none of these solutions worked for me so I thought I would "deceive" my npm cache into thinking that bcrypt@3.0.0 is 3.0.6 (because 3.0.0 works fine):

cd /path/to/your/node/project
npm install bcrypt@3.0.0
cd node_modules/bcrypt
sed -i 's/3.0.0/3.0.6/g' package.json
npm pack
npm cache add bcrypt-3.0.6.tgz

Now my npm cache thinks that bcrypt 3.0.0 is actually 3.0.6... if you try to npm install anything that depends on bcrypt 3.0.6, it should work now

acarl commented

I can also confirm that we are no longer seeing this issue. We were originally seeing it due to the sqlite3 dependency.

I'll echo the comment from @EranSch that I'm grateful for those who fixed it.
I would be interested in knowing what the actual cause was for something this disruptive. Hopefully someone will add to this issue.

Thanks for everyone's quick collaboration + looking for workarounds and supporting each other.

Turns out the cause was the release of minipass@2.8.4. So, the proper fix for this is to update to minipass@2.8.5. This should happen automatically for you as long as your package-lock.json is updated so that it no longer requests minipass@2.8.4.

More details on the fix at isaacs/minipass#9 (comment).

So, overall this was a problem that stemmed from the release of a node-pre-gyp dependency which broke node-tar, which is what node-pre-gyp uses to unpack its binaries.

Therefore I think that everyone that hit this either was not using package-lock.json (to control the minipass version) or had updated their package-lock.json sometime after the release of the broken minipass@2.8.4 (which happened 15 hours ago: https://github.com/isaacs/minipass/releases/tag/v2.8.4).

We're referencing node-pre-gyp by using fsevents and node-libcurl, after the update now I'm able to build without issues, no changes needed.

> node-libcurl@2.0.2 install /home/ec2-user/workspace/<...>/node_modules/node-libcurl
> node-pre-gyp install --fallback-to-buil
> node-pre-gyp WARN Using request for node-pre-gyp https download 
> [node-libcurl] Success: "/home/ec2-user/workspace/<...>/node_modules/node-libcurl/lib/binding/node_libcurl.node" is installed via remote

Facing the same error right now:

node-pre-gyp install --fallback-to-build --loglevel http

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp http GET https://github.com/libxmljs/libxmljs/releases/download/v0.19.7/node-v11-linux-x64.tar.gz

/ws/build/hue/rpm/BUILD/hue-release-4.5.0/node_modules/libxmljs/node_modules/node-pre-gyp/node_modules/tar/lib/create.js:4
const hlo = require('./high-level-opt.js')
^^^^^
node-pre-gyp ERR! UNCAUGHT EXCEPTION
node-pre-gyp ERR! stack SyntaxError: Use of const in strict mode.
node-pre-gyp ERR! stack at Module._compile (module.js:439:25)
node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:474:10)
node-pre-gyp ERR! stack at Module.load (module.js:356:32)
node-pre-gyp ERR! stack at Function.Module._load (module.js:312:12)
node-pre-gyp ERR! stack at Module.require (module.js:364:17)
node-pre-gyp ERR! stack at require (module.js:380:17)
node-pre-gyp ERR! stack at Object. (/ws/build/hue/rpm/BUILD/hue-release-4.5.0/node_modules/libxmljs/node_modules/node-pre-gyp/node_modules/tar/index.js:4:30)
node-pre-gyp ERR! stack at Module._compile (module.js:456:26)
node-pre-gyp ERR! stack at Object.Module._extensions..js (module.js:474:10)
node-pre-gyp ERR! stack at Module.load (module.js:356:32)
node-pre-gyp ERR! System Linux 3.10.0-957.21.3.el7.x86_64
node-pre-gyp ERR! command "node" "/ws/build/hue/rpm/BUILD/hue-release-4.5.0/node_modules/libxmljs/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--loglevel" "http"
node-pre-gyp ERR! cwd /ws/build/hue/rpm/BUILD/hue-release-4.5.0/node_modules/libxmljs
node-pre-gyp ERR! node -v v0.10.44
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in node-pre-gyp.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR! https://github.com/mapbox/node-pre-gyp/issues
npm WARN engine punycode@2.1.1: wanted: {"node":">=6"} (current: {"node":"0.10.44","npm":"2.15.0"})

i also face same problem.i found solution for that.
bcrypt required C++, python and node-pre-gyp.

sudo apt-get install g++
sudo apt-get install -y build-essential python
npm install node-pre-gyp

for more details check : https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions#ubuntu-and-derivatives---elementary-linux-mint-etc

Tried all solutions above, with sudo rm -r node_modules --force && sudo npm install in between each time. In vain, then sudo tried yarn install and it solved the issue. I really think it's not what solved the problem, but certainly one of the solutions above. But anyway, maybe give it a try..

If you are having this issue with npm bcrypt. Following solution will work for you.
kelektiv/node.bcrypt.js#632 (comment)
Worked for me too

Bom dia pessoal,
eu estava com o mesmo problema e tentei fazer tudo o que vcs falaram e nรฃo deu certo atรฉ que eu consegui resolver o erro com a ajuda de um amigo

DESINSTALE O NODE DA MAQUINA E INSTALE A VERSรƒO 11.0.0

o meu funcionou depois que eu fiz isso

Bom dia pessoal,
eu estava com o mesmo problema e tentei fazer tudo o que vcs falaram e nรฃo deu certo atรฉ que eu consegui resolver o erro com a ajuda de um amigo

DESINSTALE O NODE DA MAQUINA E INSTALE A VERSรƒO 11.0.0

o meu funcionou depois que eu fiz isso

Really? You thing that you wrote something useful? I cant understand nothing

I solved that change node version.
I used v12.x.x but after I changed version to v8.12.0. It works.

Solved installing Node version 10.19.0!

Bom dia pessoal,
eu estava com o mesmo problema e tentei fazer tudo o que vcs falaram e nรฃo deu certo atรฉ que eu consegui resolver o erro com a ajuda de um amigo
DESINSTALE O NODE DA MAQUINA E INSTALE A VERSรƒO 11.0.0
o meu funcionou depois que eu fiz isso

Really? You thing that you wrote something useful? I cant understand nothing

Google translate

Bom dia pessoal,
eu estava com o mesmo problema e tentei fazer tudo o que vcs falaram e nรฃo deu certo atรฉ que eu consegui resolver o erro com a ajuda de um amigo
DESINSTALE O NODE DA MAQUINA E INSTALE A VERSรƒO 11.0.0
o meu funcionou depois que eu fiz isso

Really? You thing that you wrote something useful? I cant understand nothing

Google translate

Olokinho mew

Solved using node v13.10.1

Solved using node v13.10.1

Thank you! Thank worked for me!

nvm install 13.10.1
nvm alias default 13.10.1
nvm use 13.10.1

...and then npm install worked! (I was on node 13.11.0)

Having same issue since days... the install works in local on Mac but not on linux server.

<...> is just a placeholder for folder name

yarn install v1.22.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.11: The platform "linux" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > ag-grid-vue@21.2.2" has incorrect peer dependency "vue-property-decorator@^7.2.0".
warning " > sass-loader@7.3.1" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
[4/4] Building fresh packages...
[11/14] โ  node-sass
[2/14] โ  grpc
[-/14] โ  waiting...
[-/14] โ ‚ waiting...
error /<...>/public_html/<...>/node_modules/grpc: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build --library=static_library
Arguments:
Directory: /<...>/public_html/<...>/node_modules/grpc
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.13.0
node-pre-gyp info using node@13.9.0 | linux | x64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/<...>/public_html/<...>/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc/grpc_node.node" (not found)
node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v79-linux-x64-glibc.tar.gz
node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v79-linux-x64-glibc.tar.gz
node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v79-linux-x64-glibc.tar.gz
node-pre-gyp WARN Pre-built binaries not found for grpc@1.23.3 and node@13.9.0 (node-v79 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://node-precompiled-binaries.grpc.io/grpc/v1.23.3/node-v79-linux-x64-glibc.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@13.9.0 | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@13.9.0 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args '/<...>/public_html/<...>/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/<...>/public_html/<...>/node_modules/grpc/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/<...>/public_html/<...>/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/<...>/.node-gyp/13.9.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/<...>/.node-gyp/13.9.0',
gyp info spawn args '-Dnode_gyp_dir=/<...>/public_html/<...>/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/<...>/.node-gyp/13.9.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/<...>/public_html/<...>/node_modules/grpc',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@13.9.0 | linux | x64
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/<...>/public_html/<...>/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/<...>/public_html/<...>/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/<...>/public_html/<...>/node_modules/which/which.js:80:29)
gyp ERR! stack at /<...>/public_html/<...>/node_modules/which/which.js:89:16
gyp ERR! stack at /<...>/public_html/<...>/node_modules/isexe/index.js:42:5
gyp ERR! stack at /<...>/public_html/<...>/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:170:21)
gyp ERR! System Linux 4.15.0-88-generic
gyp ERR! command "/usr/bin/node" "/<...>/public_html/<...>/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/<...>/public_html/<...>/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/<...>/public_html/<...>/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v79"
gyp ERR! cwd /<...>/public_html/<...>/node_modules/grpc
gyp ERR! node -v v13.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /<...>/public_html/<...>/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/<...>/public_html/<...>/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/<...>/public_html/<...>/node_modules/grpc/src/node/extension_binary/node-v79-linux-x64-glibc --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v79' (1)
node-pre-gyp ERR! stack at ChildProcess. (/<...>/public_html/<...>/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:321:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1026:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 4.15.0-88-generic
node-pre-gyp ERR! command "/usr/bin/node" "/<...>/public_html/<...>/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /<...>/public_html/<...>/node_modules/grpc
node-pre-gyp ERR! node -v v13.9.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /<...>/public_html/<...>/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/<...>/public_html/<...>/node_modules/grpc/src/node/extension_binary/node-v79-li

bbaki commented

Solved by manually installing / adding "node-pre-gyp": "0.14.0" to package.json.
Were working on Nodejs: 12.16.1, Yarn: 1.22.0

My issue was with a dockerfile using node:12.16-alpine as base image.

For me none of the solutions proposed above worked.
I was able to solve adding RUN npm i -g node-pre-gyp@0.14.0 before the install command

Example:

FROM node:12.16-alpine as builder

RUN mkdir /app
WORKDIR /app

RUN npm i -g node-pre-gyp@0.14.0 # <=== HERE!

COPY ./package.json ./
COPY ./yarn.lock ./
RUN yarn --frozen-lockfile --no-cache

....

not ideal but a workaround is to manually add "node-pre-gyp": "0.12.0" as a devDev to your package.json

Thanks my man, it works for me.

I managed to skip the bcrypt error by adding this before installing the package.json

npm --build-from-source install bcrypt

This solved my issue. Thanks

just downgrade the version
npm install --save bcrypt@3.0.6 --nodedir

One of solutions could be downgrading node version to 10.19.0.
Use nvm to change node version easily.
Try out, this solution may be exact for your error.

hi all any updates on this ?
Tried npm install --save bcrypt@3.0.6 --nodedir didn't work
tried npm --build-from-source install bcrypt didn't work
and tired the workaround of adding "node-pre-gyp": "0.12.0" as a devDev to the package.json
also didn't work

Any other ideas or solutions

@samernady I tried all those solutions as well, the only thing that worked for me was to downgrade to node 10.19.0 using node version manager (nvm). i.e nvm install 10.19.0

hi all.
we had the same issue installing grpc. If your error messages contain the following line:
node-pre-gyp WARN Using needle for node-pre-gyp https download
maybe installing request could be a solution.
npm install request
In our case the problem was solved.
After that message was changed to:
node-pre-gyp WARN Using request for node-pre-gyp https download and grpc was installed successful.

npm ERR! bcrypt@4.0.1 install: node-pre-gyp install --fallback-to-build

yep I am getting this error too, and have tried all solution above ;(

*All else fails solution: I gave up on bcrypt by removing it entirely from my production, and installed bcryptjs instead.

I was having the same problem using the image of the docker docker:alpine the node has been changed to remove the python so just use node:12 that works

One of solutions could be downgrading node version to 10.19.0.
Use nvm to change node version easily.
Try out, this solution may be exact for your error.

This whole nodejs thing is crap. The latest versions of things should work. Having to roll back to make something work is junky. Everything surrounding NPM is in constant break-change.

However, your suggestion works.

I'm having the same issue, but it's failing on AWS beanstalk npm install
I have installed node-pre-gyp@0.14.0 mnually adding it to package.json
I have downgraded the node environment from 12.16.1 to 10.19.0

I have rebuilt the whole environment (just to clear off any caching problems)
the weird problem is , it's not even giving me what's missing ? cannot find module '../' ?

on my local it runs fine without the above steps and on node 12.16.2 - but failing on AWS beanstalk

Note that sqlite3 4.1.1 is already added to package.json

any suggestions ?

sqlite3@4.1.1 install /tmp/deployment/application/node_modules/sqlite3
node-pre-gyp install --fallback-to-build

internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module '../'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/tmp/deployment/application/node_modules/sqlite3/node_modules/.bin/node-pre-gyp:15:20)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.1.1 install: node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/.npm/_logs/2020-04-30T10_39_16_056Z-debug.log
Running npm install: /opt/elasticbeanstalk/node-install/node-v10.19.0-linux-x64/bin/npm
Setting npm config jobs to 1
npm config jobs set to 1
Running npm with --production flag
Failed to run npm install. Snapshot logs for more details.
UTC 2020/04/30 10:39:16 cannot find application npm debug log at /tmp/deployment/application/npm-debug.log

Traceback (most recent call last):
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 695, in
main()
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 677, in main
node_version_manager.run_npm_install(options.app_path)
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 136, in run_npm_install
self.npm_install(bin_path, self.config_manager.get_container_config('app_staging_dir'))
File "/opt/elasticbeanstalk/containerfiles/ebnode.py", line 180, in npm_install
raise e
subprocess.CalledProcessError: Command '['/opt/elasticbeanstalk/node-install/node-v10.19.0-linux-x64/bin/npm', '--production', 'rebuild']' returned non-zero exit status 1 (Executor::NonZeroExitStatus)

first install - npm install request after npm install bcrypt.

This worked for me

hcq11 commented

hi all.
we had the same issue installing grpc. If your error messages contain the following line:
node-pre-gyp WARN Using needle for node-pre-gyp https download
maybe installing request could be a solution.
npm install request
In our case the problem was solved.
After that message was changed to:
node-pre-gyp WARN Using request for node-pre-gyp https download and grpc was installed successful.

This worked for me ,I can not download it ,so I set proxy via npm config set proxy = http://ip:port,

I was trying to install it on WSL 2, none of the solutions mentioned above worked. I looked around and found that components required to build the cpp codes were missing, so I installed them using:
sudo apt-get install build-essential gdb
Then installed bcrypt, which worked.

npm --build-from-source install bcrypt@3.0.6 works for me as a workaround. I'm calling manually from a postinstall script and just removed it from the dependancies for now.

It Works for me! Thank you!

Installation
You can install with npm:

$ npm install -g node-gyp

https://www.npmjs.com/package/node-gyp/v/3.7.0#installation

Me too have the same problem. Is anybody solved it?

@ibs-ns So I just started a new job, and ran into this issue on a fresh laptop.

Turns out, when I brew installed npm, it installed the latest version. Simply downgrading to node@10 (what my teammates were using) fixed the issue.

Solved this issue by DownGrading my nodeJs version to 10.13.0 Via NVM

HOW TO INSTALL NVM

Solved this issue by DownGrading my nodeJs version to 10.13.0 Via NVM

HOW TO INSTALL NVM

downgrading from v13.14.0 to v10.13.0 worked for me

Solved installing Node version 10.19.0!

Worked fo me too!

Solved this issue by DownGrading my nodeJs version to 10.13.0 Via NVM

HOW TO INSTALL NVM

THIS IS SO DUMB BUT IT WORKED FOR ME ๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ

I managed to skip the bcrypt error by adding this before installing the package.json

npm --build-from-source install bcrypt

I would suggest this. It helped me. Along with adding "node-pre-gyp": "0.12.0" to package.json. =)

Solved this issue by DownGrading my nodeJs version to 10.13.0 ...

Downgrading node work for me to!, thk
from v14 to v12

Solved using node v13.10.1

thank u, it was worked for me:)

nvm install 13.10.1

Just one upgrade solved my issue.

Lonor commented

node v12.18.3 same problem:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I don't wanna upgrade the node version. How can I fix this?

My workaround for this is by installing these two

apt-get install g++
sudo apt-get install -y build-essential python

and after that you're good to go...

Hi all,

I'm having the same issue when I try to npm install locally on a project folder.

Specifically, it runs into this issue with the sqlite3 package, which I desperately need for this project.

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/nunoferrao/n/bin/node" "/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64"
gyp ERR! cwd /Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/nunoferrao/n/bin/node /Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/Users/nunoferrao/n/bin/node" "/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3
node-pre-gyp ERR! node -v v12.18.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok 
Failed to execute '/Users/nunoferrao/n/bin/node /Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64' (1)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: can't open file: Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o (No such file or directory)
make: *** [Release/sqlite3.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/nunoferrao/n/bin/node" "/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64"
gyp ERR! cwd /Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN x-press-publishing@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@3.1.13 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@3.1.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I tried the following so far:

  • uninstall and reinstall node/npm
  • uninstall and reinstall node/npm through n
  • tried npm install after downgrading node version from v12.18.3 to v10.13.0
  • tried npm --build-from-source install

Nothing seems to work.

Me going crazy. I'm still a programming noobie trying to learn webdevelopment, but I can't even seem to get started lol.

Any help would be veeery appreciated.

Thanks.
Nuno

Hi all,

I'm having the same issue when I try to npm install locally on a project folder.

Specifically, it runs into this issue with the sqlite3 package, which I desperately need for this project.

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/nunoferrao/n/bin/node" "/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64"
gyp ERR! cwd /Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/nunoferrao/n/bin/node /Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Darwin 19.6.0
node-pre-gyp ERR! command "/Users/nunoferrao/n/bin/node" "/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3
node-pre-gyp ERR! node -v v12.18.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok 
Failed to execute '/Users/nunoferrao/n/bin/node /Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64' (1)
error: /Library/Developer/CommandLineTools/usr/bin/libtool: can't open file: Release/obj.target/sqlite3/gen/sqlite-autoconf-3150000/sqlite3.o (No such file or directory)
make: *** [Release/sqlite3.a] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/Users/nunoferrao/n/bin/node" "/Users/nunoferrao/n/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=/Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3/lib/binding/node-v72-darwin-x64"
gyp ERR! cwd /Users/nunoferrao/Documents/Webdev/Codecademy/capstone-project-1-x-press-publishing/node_modules/sqlite3
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm WARN x-press-publishing@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@3.1.13 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sqlite3@3.1.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I tried the following so far:

  • uninstall and reinstall node/npm
  • uninstall and reinstall node/npm through n
  • tried npm install after downgrading node version from v12.18.3 to v10.13.0
  • tried npm --build-from-source install

Nothing seems to work.

Me going crazy. I'm still a programming noobie trying to learn webdevelopment, but I can't even seem to get started lol.

Any help would be veeery appreciated.

Thanks.
Nuno

What operating system you use?

@nuno-ferrao Would it be possible to use a more recent version of sqlite3 in your project? 3.1.13 is pretty old. I don't think the prebuilt binary it tries to install for your OS is available any longer (see output below from Ubuntu 18.04), hence it trying to build from source. Also, building from source might not work in Node v10 or v12 because the source might contain code that's no longer supported in those versions.

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v72-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@12.18.2 (node-v72 ABI) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v72-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@12.18.2 (node-v72 ABI) (falling back to source compile with node-gyp)

Hi Netbek, thanks a lot for your reply.

Well, I'm just running npm install as a command. I'm not specifying any specific sqlite3 version. I assumed the script installed the latest, since my npm version is -to my knowledge- up-to-date.

How can I fix this?

Thanks for your help.
Nuno

@nuno-ferrao In the output you posted, it appears that the current working directory is capstone-project-1-x-press-publishing. I'm guessing there's a package.json file. Is there an entry for sqlite3 in that file?

Yes, there is. Its contents are the following:

{
  "name": "x-press-publishing",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "scripts": {
    "test": "mocha"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "chai": "^4.1.2",
    "mocha": "^3.5.0",
    "random-flat-colors": "^1.0.4",
    "react": "^15.6.1",
    "react-dom": "^15.6.1",
    "react-router-dom": "^4.2.2",
    "sqlite3": "^3.1.9",
    "supertest": "^3.0.0",
    "whatwg-fetch": "^2.0.3"
  },
  "devDependencies": {
    "babel": "^6.23.0",
    "babel-core": "^6.26.0",
    "babel-loader": "^7.1.2",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1",
    "webpack": "^3.5.5"
  }
}

Could you enlighten me as to how this works?

I understand that running npm install creates a package-lock.json file, but as you pointed out this project folder had a package.json already. How does this all fit together? I'd like to understand.

Thanks!