Bcrypt 1.x major issues, won't deploy to Galaxy

I tried to deploy my app and I get the following error:

v086
2016-12-04 19:41:07-08:00> bcrypt@1.0.0 install /app/bundle/programs/server/npm/node_modules/bcrypt
v086
2016-12-04 19:41:07-08:00> node-pre-gyp install --fallback-to-build
v086
2016-12-04 19:41:07-08:00
v086
2016-12-04 19:41:07-08:00sh: 1: node-pre-gyp: not found
v086
2016-12-04 19:41:07-08:00
v086
2016-12-04 19:41:07-08:00npm ERR! Linux 4.4.0-45-generic

When I downgrade to bcrypt 0.8.7, it works fine.

Per this thread: Is build-essentials installed on the Galaxy containers?

I have had the same problem when deploying my application with Mup. So far I haven’t found a solution, so I just decided to remove the package, then it worked fine. Not ideal though…

Update on this:

build-essential (singular) is installed on the default Galaxy base image.

What version of Meteor are you using?

As a workaround, you can continue to install the older bcrypt — this is something you installed yourself with npm install, right?

Meteor 1.4.2.3. Yes, I can use bcrypt 0.8.7 and it works fine. I did install bcrypt myself, I was kinda forced to. Without it, Meteor repeatedly complains (on server-side) about using a less-than-efficient JavaScript bcrypt implementation. Not sure why.

Thanks David! What do you recommend going forward? Is this a Meteor issue or a bcrypt 1.x issue?

This looks like a Meteor build tool issue. I’ve filed https://github.com/meteor/meteor/issues/8136 and asked Ben (who understands the build tool’s current behavior better than I do) to take a look.

For this particular issue, meteor npm install --save bcrypt@0.8.7 should fix it without loss of functionality, as bcrypt@1.0.0 only has this build system change and a new Promise-based API that Meteor doesn’t use.

2 Likes

Cool, thanks for your help!

I ran in to this issue today on Galaxy after updating project to Meteor 1.4. Getting the error:

2017-05-25 13:09:07-07:00node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v46-linux-x64.tar.gz
v138
2017-05-25 13:09:07-07:00node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@4.8.2 (node-v46 ABI) (falling back to source compile with node-gyp)
v138
2017-05-25 13:09:08-07:00make: Entering directory `/app/bundle/programs/server/npm/node_modules/bcrypt/build'
v138

I tried the above solution for --save bcrypt@0.8.7, and that errors as well.

n

pm ERR! Failed at the bcrypt@0.8.7 install script 'node-gyp rebuild'.
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 bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs bcrypt
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls bcrypt