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

Most upvoted comments

@kirkins thx npm i -D bcrypt@3.0.0 is in effect

Upgrading 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-source

Rolling 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-source is problematic for folks who then need to update CI scripts to workaround this.

I could suggest, un-publishing the node-v57 prebuilt 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:

[1] dyld: lazy symbol binding failed: Symbol not found: __ZN4node19GetCurrentEventLoopEPN2v87IsolateE
[1]   Referenced from: /Users/jt/Documents/Projects/Brainy-Kidz/node_modules/bcrypt/lib/binding/bcrypt_lib.node
[1]   Expected in: flat namespace
[1]
[1] dyld: Symbol not found: __ZN4node19GetCurrentEventLoopEPN2v87IsolateE
[1]   Referenced from: /Users/jt/Documents/Projects/Brainy-Kidz/node_modules/bcrypt/lib/binding/bcrypt_lib.node
[1]   Expected in: flat namespace

same issue - rolling back to 3.0.0 as @kirkins said fixes the issue.

I think the docker container abernix/meteord:node-8.4.0-base may be using a version of node that causes this issue with bcrypt upon deployment.

I think when we are able to use a version of node that is 12.14.0 or above, we can then start using bcrypt 3.0.7, without the need to downgrade the package version to 3.0.0 when you want to deploy.

This would be ideal.

Upgrading my Node engine from 8.9.0 to 8.12.0 solved the problem.

We were using abernix/meteord:node-8.9.0-base in our Meteor.js project, changing that to abernix/meteord:node-8.12.0-base fixed 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.