Npm bcrypt and meteor npm bcrypt madness

Did you get this working?

This is driving me nuts… I tried the above remedies, none of which fixed it.

Now it complains every time I run meteor, even after issuing the command to install bcrypt

npm rebuild didn’t help. Trying to remove node-bcrypt didn’t work, Meteor just put it back in there.

Can someone please provide a fix for this?

In fact, while I’m on my soapbox, Meteor will tell me that an npm module is missing and may cause problems. Why can’t it just install the package, or at least prompt me to do so? A common problem among the dev team is caused by this, after doing a “git pull” an “npm install” is necessary to install any newly introduced packages. This is a time waster that (I think) could be fixed quite easily. After all, if the .meteor/packages file has a new entry, Meteor will fetch that and install it. Can’t it do the same with npm modules?

6 Likes

Same issue on Windows and Mac. Tried the solutions above on Mac, minus the windows specific build part. Still get the full list of errors. And yes, it is very annoying to see those warnings int he terminal when you start meteor.

1 Like

I’m on Mac, rebuild works for me.
Remove bcrypt from package.json and .meteor/package, then do

meteor npm install --save bcrypt
meteor npm rebuild

Hooray, no more warnings!

6 Likes

Solved this (what a hell). This works:

meteor add npm-bcrypt
meteor add accounts-password

this doesn’t:
meteor npm install bcrypt
meteor add accounts-password

5 Likes

Try this.

Incredible how far Meteor has fallen. Cant even add basic user authentication without running into a ton of issues with no clear fix. I came to Meteor for the simplicity, it’s simply horrendous how MDG has butchered and treated their product.

2 Likes

This is one issue which is easily solved.

The best explanation for El Capitan+

El Capitan’s new System Integrity Protection feature prevents changes to several core parts of OS X, including most of /usr, even by root. Local customizations, such as what you’re doing, belong in /usr/local instead. /usr/local/bin doesn’t exist by default, but you can create it and put custom binaries (an aliases) in it:

sudo mkdir -p /usr/local/bin
sudo ln -s /usr/bin/python2.7 /usr/local/bin/python2
(Note that /usr/local/bin doesn’t exist by default, it is in the default PATH, so as soon as you create it, it’ll be searched for commands.)

It’s also possible to disable System Integrity Protection, but it’s generally best to leave it on and do customization in more appropriate locations. See this apple.SE question for more details.

So symlink your gcc / g++ and likely meteor npm install --save bcrypt will work just fine

Yep, this is so sad… moving to arunoda stack

This happens on my live build.

I fixed it by:
cd {project-name}/programs/server/
rm -rf node_modules
npm i

My specs:
node v4.7.2
meteor 1.4.3.2

1 Like

I just want to say that the issues here aren’t completely Meteor/MDG’s fault, this is the kind of stuff we have to face a lot with npm as soon as the basic stuff doesn’t work. And you are immediately deep in Linux hell.

Another example is canvas. The instructions for installing it and getting it working are complex, and you basically have to hope some on stackoverflow has answered it.

2 Likes

correct me if I am wrong but I believe the bcrypt message is also tied to errors in resolving the file path to a working copy of Python 2.7. I had the error message and after pointing npm to my Python 2.7 installation (I have multiple versions of Python installed) and then removing bcrypt, re-add it, npm rebuild and the messages went away.

1 Like

Yes - the build requirements for bcrypt are quite stringent:

NodeJS

  • node-gyp
    Please check the dependencies for this tool at: https://github.com/nodejs/node-gyp
    Windows users will need the options for c# and c++ installed with their visual studio instance.
  • Python 2.x
    *OpenSSL - This is only required to build the bcrypt project if you are using versions <= 0.7.7. Otherwise, we’re using the builtin node crypto bindings for seed data (which use the same OpenSSL code paths we were, but don’t have the external dependency).

node-gyp is equally stringent (and potentially complex for Windows users):

On Unix:
python (v2.7 recommended, v3.x.x is not supported)
make
A proper C/C++ compiler toolchain, like GCC

On Mac OS X:
python (v2.7 recommended, v3.x.x is not supported) (already installed on Mac OS X)
Xcode
You also need to install the Command Line Tools via Xcode. You can find this under the menu Xcode -> Preferences -> Downloads
This step will install gcc and the related toolchain containing make

On Windows:

Option 1: Install all the required tools and configurations using Microsoft’s windows-build-tools using npm install --global --production > windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).
Option 2: Install tools and configuration manually:

Visual C++ Build Environment:

Option 1: Install Visual C++ Build Tools using the Default Install option.

Option 2: Install Visual Studio 2015 (or modify an existing installation) and select Common Tools for Visual C++ during setup. This also > works with the free Community and Express for Desktop editions.

[Windows Vista / 7 only] requires .NET Framework 4.5.1
Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying > the proper Python version and path.)

Launch cmd, npm config set msvs_version 2015

However, if you follow the requirements, bcrypt is perfectly buildable.

4 Likes

@NotaSRSbiz: I’m the one who opened this issue many moons ago. Once I solved the issue it hasn’t come back up. This was much more simple than building DDP and auth & auth on my own by hand.

Fact - Web Development today is complicated and constantly changing. A developer runs into huge “problems” all of the time. Especially when using technologies that you don’t personally understand like “bcrypt” - I still to this day don’t completely understand what it does. I just know it’s important for auth and auth. I’m also grateful that I didn’t have to figure this part out and that somebody else did.

I’m amazed at how fast people are willing to throw entire stacks of other developer’s work under a bus when it doesn’t just “work” when they simply copy and paste somebody else’s code into their project that their charging full price for.

I am personally extremely grateful for Meteor and everything they have done for the web development community. I’m happy to help solve any problem I run into. The community is great, and strong and extremely helpful. Please have a little respect.

By the way, Thanks everyone for your suggestions on how to solve this problem. I’m not sure what it was that solved my problem. It was a combination of removing and installing bcrypt “the right way” for my system. I would have commented, but I don’t actually know what solved my problem. I can say this - once I got it solved, it didn’t come back.

6 Likes

@robfallows: Thank you for such a detailed and canonical answer.

3 Likes

This warning is still popping back up every time I install an NPM package. Like the other people here, following the instructions of running meteor npm install --save bcrypt does not solve it for me.

meteor remove bcrypt
meteor npm add bcryptjs

done

or as said before, use node-gyp and install bcrypt that way

1 Like

When I install an npm package, I get the following errors/warnings:

Uniti-MBP:envoy2 rijk$ npm install --save react-s3-uploader
npm WARN deprecated node-uuid@1.4.7: use uuid module instead

> bcrypt@1.0.2 install /Users/Rijk/Code/Projects/envoy2/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-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-v47-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@5.5.0 (node-v47 ABI) (falling back to source compile with node-gyp) 
  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
  SOLINK_MODULE(target) Release/bcrypt_lib.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9
  COPY /Users/Rijk/Code/Projects/envoy2/node_modules/bcrypt/lib/binding/bcrypt_lib.node
  TOUCH Release/obj.target/action_after_build.stamp
envoy@2.0.0 /Users/Rijk/Code/Projects/envoy2
└── bcrypt@1.0.2 

npm WARN worker-loader@0.7.1 requires a peer of webpack@>=0.9 <2 || ^2.1.0-beta but none was installed.

Does this mean there’s something misconfigured in my local Node install or something?

After this, when I run Meteor, I always get the “Note: you are using a pure-JavaScript implementation of bcrypt.” warning again.

Have you tried to run: meteor remove bcrypt and then meteor npm add bcryptjs?