node.bcrypt.js: symbol lookup error undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE
I installed bcrypt@3.0.1 version for my project. It worked for a while, but now when I start with node command, the program exit with this error:
node app.js
node: symbol lookup error: /var/www/myproject/node_modules/bcrypt/lib/binding/bcrypt_lib.node: undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE
This is the case if I use with nodemon:
nodemon app.js
[nodemon] 1.15.0 [nodemon] to restart at any time, enter rs[nodemon] watching: *.* [nodemon] startingnode app.js /usr/local/bin/node: symbol lookup error: /var/www/myproject/node_modules/bcrypt/lib/binding/bcrypt_lib.node: undefined symbol: _ZN4node19GetCurrentEventLoopEPN2v87IsolateE [nodemon] failed to start process, "node" exec not found [nodemon] Error
If I use
nodejs app.js
Its works
My node version: v8.4.0 My nodejs version v8.11.3
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 19 (1 by maintainers)
Commits related to this issue
- Fix node version in package.json engine apporx > 8 && < 8.12 has issues with bcrypt see: https://github.com/kelektiv/node.bcrypt.js/issues/656 — committed to AckeeCZ/desmond by smolijar 6 years ago
- downgrading bcrypt until this is fixed - https://github.com/kelektiv/node.bcrypt.js/issues/656 — committed to winsleague/winsleague by noahsw 6 years ago
- downgrading bcrypt until this is fixed - https://github.com/kelektiv/node.bcrypt.js/issues/656 (#520) — committed to winsleague/winsleague by noahsw 6 years ago
- :bug: fix(deps): downgrade bcrypt See - https://github.com/kelektiv/node.bcrypt.js/issues/656 - https://github.com/jshimko/meteor-launchpad/pull/126 — committed to infoderm/patients by make-github-pseudonymous-again 6 years ago
- Bump node version to 8.12.0 to fix symbol error in crypt, see https://github.com/kelektiv/node.bcrypt.js/issues/656#issuecomment-428821577 — committed to gentoo-mirror/awesome by deleted user 6 years ago
@kirkins thx
npm i -D bcrypt@3.0.0is in effectUpgrading my Node engine from 8.9.0 to 8.12.0 solved the problem.
It’s unfortunate that the NodeJS folks broke API in between releases. There is nothing much we can do in this regard. You can force a recompile using
npm rebuild bcrypt --build-from-sourceRolling back to 3.0.0 from 3.0.1 fixed it for me.
I’m concerned this issue is closed while the problem persists. It may be “NodeJS’s fault” however the end result is an unusable build and a breaking change between 3.0.0 and 3.0.1 for certain users.
So, I understand it is w/r/t prebuilt bcrypt, which is built against a specific N-API and something in the API changed (somewhere between 8.9 and 8.12) without node revving the API version (v57.)
I can reproduce with bcrypt 3.0.2 and nodejs 8.9.4, on both MacOS and Linux.
I actually wonder if rolling back to v3.0.0 works for folks because there is no prebuilt package for
v3.0.0-node-v57-darwin-x64-unknown(there are prebuilt darwin packages for bcrypt 3.0.1 and 3.0.2.) Or if v3.0.0 was just coincidentally built against an earlier version of node, before the breaking API change.Adding
npm rebuild bcrypt --build-from-sourceis problematic for folks who then need to update CI scripts to workaround this.I could suggest, un-publishing the
node-v57prebuilt binaries - it would force the “build-from-source” fallback to always occur when no prebuilt binary is found.I’m also seeing this issue on macOS 10.14.
My terminal is outputting:
same issue - rolling back to 3.0.0 as @kirkins said fixes the issue.
We were using
abernix/meteord:node-8.9.0-basein our Meteor.js project, changing that toabernix/meteord:node-8.12.0-basefixed our issue.I was having the same issue with my production build through Heroku. Updating my node and npm engines on my package.json file to be the latest versions fixed the problem. Running bcrypt 3.0.4.