Npm bcrypt and meteor npm bcrypt madness

I fixed this error with:
ls node_modules | grep bcrypt
rm -rf node_modules/bcrypt-pbkdf
meteor npm install --save bcrypt

6 Likes

@gemmi & @henribeck, thanks so much - If it comes up again, I’ll try what you did there Gemmi, along with making sure bcrypt is completely uninstalled from both package files and report back.

So accounts-password depends on npm-bcrypt which I think is the culprit here. It adds npm-bcrypt@0.9.1 to my meteor/versions files.

I’ve used meteor npm rebuild after that I didn’t see the notice again.
Mention here: https://guide.meteor.com/1.4-migration.html#binary-packages-require-build-toolchain

1 Like

meteor npm rebuild not working for me…

See my answer here:

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