Node.bcrypt.js: Could not locate the bindings file on Ubuntu

Created on 10 Mar 2016  Â·  1Comment  Â·  Source: kelektiv/node.bcrypt.js

System info:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

$ node --version
v4.3.1

The error message during login to our application

/home/myproject/node_modules/bcrypt/node_modules/bindings/bindings.js:91
  throw err
  ^

Error: Could not locate the bindings file. Tried:
 → /home/myproject/node_modules/bcrypt/build/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/build/Debug/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/build/Release/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/out/Debug/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/Debug/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/out/Release/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/Release/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/build/default/bcrypt_lib.node
 → /home/myproject/node_modules/bcrypt/compiled/4.3.1/linux/x64/bcrypt_lib.node
    at bindings (/home/myproject/node_modules/bcrypt/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/home/myproject/node_modules/bcrypt/bcrypt.js:3:35)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Function.userSchema.statics.validatePassword (/home/myproject/schema/User.js:79:18)
    at EventEmitter.<anonymous> (/home/myproject/passport.js:31:28)
    at emitOne (events.js:77:13)
    at EventEmitter.emit (events.js:169:7)
    at Query.<anonymous> (/home/myproject/passport.js:26:20)
    at /home/myproject/node_modules/mongoose/node_modules/kareem/index.js:177:19
    at /home/myproject/node_modules/mongoose/node_modules/kareem/index.js:109:16
    at nextTickCallbackWith0Args (node.js:415:9)
    at process._tickCallback (node.js:344:13)

The interesting thing is that this happens occasionally, 1 of 3 deployments are causing such error.

Most helpful comment

I figured out later that this error happened in deployments that contained incomplete build of brcypt. During our deployment npm install allocated all the memory that was available on the aws instance.

When it came to building brcypt the build failed because it ran of of memory, but the npm install itself doesn't failed so we never noticed this.

We had no swap area on aws but after allocating one the build never runs out of memory.

>All comments

I figured out later that this error happened in deployments that contained incomplete build of brcypt. During our deployment npm install allocated all the memory that was available on the aws instance.

When it came to building brcypt the build failed because it ran of of memory, but the npm install itself doesn't failed so we never noticed this.

We had no swap area on aws but after allocating one the build never runs out of memory.

Was this page helpful?
0 / 5 - 0 ratings