socialight
socialight

Reputation: 517

accounts-password from meteor breaking because of bcrypt

I am getting this error:

Error: Can't find npm module 'bcrypt'. Did you forget to call 'Npm.depends' in package.js within the 'npm-bcrypt' package?

I'm not sure what to make of it.. I am just learning meteor but I have userd accounts-password and accounts-ui before without any problems. However now its asking for dependencies. If I comment out the accounts-password page in ".meteor/packages" then the server will boot up without problems.

Has anyone had this problem before? This is the full error.

W20150602-09:54:54.633(-7)? (STDERR)
W20150602-09:54:54.635(-7)? (STDERR) /Users/VCarlos/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245 W20150602-09:54:54.635(-7)? (STDERR) throw(ex); W20150602-09:54:54.635(-7)? (STDERR) ^ W20150602-09:54:54.639(-7)? (STDERR) Error: Can't find npm module 'bcrypt'. Did you forget to call 'Npm.depends' in package.js within the 'npm-bcrypt' package? W20150602-09:54:54.640(-7)? (STDERR) at Object.Npm.require (/Users/VCarlos/Dropbox/wdi/inslim/.meteor/local/build/programs/server/boot.js:155:17) W20150602-09:54:54.640(-7)? (STDERR) at Package (packages/npm-bcrypt/wrapper.js:1:1) W20150602-09:54:54.640(-7)? (STDERR) at /Users/VCarlos/Dropbox/wdi/inslim/.meteor/local/build/programs/server/packages/npm-bcrypt.js:21:4 W20150602-09:54:54.640(-7)? (STDERR) at /Users/VCarlos/Dropbox/wdi/inslim/.meteor/local/build/programs/server/packages/npm-bcrypt.js:30:3 W20150602-09:54:54.641(-7)? (STDERR) at /Users/VCarlos/Dropbox/wdi/inslim/.meteor/local/build/programs/server/boot.js:222:10 W20150602-09:54:54.641(-7)? (STDERR) at Array.forEach (native) W20150602-09:54:54.642(-7)? (STDERR) at Function..each..forEach (/Users/VCarlos/.meteor/packages/meteor-tool/.1.1.3.1wysac9++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11) W20150602-09:54:54.642(-7)? (STDERR) at /Users/VCarlos/Dropbox/wdi/inslim/.meteor/local/build/programs/server/boot.js:117:5

Upvotes: 2

Views: 1325

Answers (3)

Jake
Jake

Reputation: 1000

I have found that many of my bugs occur when I install or uninstall packages from my project while the server is still running. Simply restarting my server fixed my bcrypt issue.

Upvotes: 1

Luiz
Luiz

Reputation: 153

The accepted answer didn't work for me, but this did:

rm -rf ~/.meteor/packages/npm-bcrypt.

Then after running meteor it downloaded bcrypt again and all was fine.

Upvotes: 1

Tarang
Tarang

Reputation: 75945

This is happening because you create your bundle on one platform (OS X, Windows, etc) then deploy your project on another platform (different from the original).

To fix this install bcrypt in your app:

In your untarred and ungziped directory:

(cd programs/server && npm install)
cd programs/server/npm/npm-bcrypt/node_modules/
rm -rf bcrypt
npm install bcrypt

Since yours is a development mode you may have to go into .meteor/local/build to make get to the bundle directory.

Your app has a weird structure its not common to have the packages/npm-bcrypt in your app. This is a native meteor package. You may want to contact the author of the app to ask why s/he has placed this package here and if its not modified remove it so Meteor can use the native bcrypt package designed for your platform.

Upvotes: 4

Related Questions