profile
viewpoint

Ask questionsError: Cannot find module '...../bcrypt/lib/binding/napi-v3/bcrypt_lib.node'

After installing the newest version of node 12.6.3 and installing bcrypt 4.0.1 in my project, "npm install bcrypt" added the package successfully without errors, but then running "node app.js" I get:

Error: Cannot find module 'path_to_my_project/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node'

And indeed the folder node_modules/bcrypt/lib is not there at all...

Why would installation not make this folder? I suspect it's something to do with node-gyp not doing it's thing, but why don't I get an error message when i do npm install?

And I tried reverting to my old node version 8.11.1 using https://www.npmjs.com/package/n to manage my node versions and then installing bcrypt 2.0.1 (like I had previously), but it's behaving the exact same way... npm install adds the package but the bcrypt/lib folder is missing. I also tried with node 12.6.1 and 12.6.2, same thing.

kelektiv/node.bcrypt.js

Answer questions spicecoder

node-pre-gyp install --fallback-to-build.. solved my issue too thanks

useful!

Related questions

npm install bcrypt@3.0.6 fails with node 12.3.0 hot 2
Unable to install bcrypt (WSL) hot 2
[Question] Difference between bcrypt and bcryptjs hot 1
Unable to install bcrypt (WSL) hot 1
Cannot install bcrypt hot 1
'nan_callbacks.h' file not found hot 1
process.dlopen(module, path.toNamespacedPath(filename)) hot 1
dyld: lazy symbol binding failed: Symbol not found hot 1
Bcrypt failed to install via npm or yarn hot 1
Bcrypt failed to install via npm or yarn hot 1
Cannot install bcrypt hot 1
npm install bcrypt@3.0.6 fails with node 12.3.0 hot 1
BCrypt fails to install on Node v12.4.0 hot 1
Bcrypt failed to install via npm or yarn hot 1
Bcrypts npm install fails in docker container with node 10.16.0 hot 1
source:https://uonfu.com/
Github User Rank List