dcodeIO / bcrypt.js

Optimized bcrypt in plain JavaScript with zero dependencies.
Other
3.47k stars 264 forks source link

node_modules\bcrypt\lib\binding\bcrypt_lib.node is not a valid Win32 application. #112

Closed siddiqlm closed 4 years ago

siddiqlm commented 4 years ago

I installed bcrypt in my local machine and it is working fine. But when I deployed the files in the Microsoft Azure I am getting the following error

Application has thrown an uncaught exception and is terminated: Error: \?\D:\home\site\wwwroot\node_modules\bcrypt\lib\binding\bcrypt_lib.node is not a valid Win32 application.

\?\D:\home\site\wwwroot\node_modules\bcrypt\lib\binding\bcrypt_lib.node at Object.Module._extensions..node (internal/modules/cjs/loader.js:717:18) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object. (D:\home\site\wwwroot\node_modules\bcrypt\bcrypt.js:6:16) at Module._compile (internal/modules/cjs/loader.js:688:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10) at Module.load (internal/modules/cjs/loader.js:598:32)

Is there any separate brcypt package available to install with 32-bit node?

I am trying to upgrade it to 64-bit node in Microsoft Azure. But no luck so far. So I decided to try install bcypt package for 32-bit node. Could someone help me with this?

dcodeIO commented 4 years ago

bcrypt is a native package, while bcryptjs (this package) is pure JS and should work everywhere.

siddiqlm commented 4 years ago

bcryptjs is working great. Thank you so much @dcodeIO .

NutonC commented 4 years ago

how solved brother ....i still not solved

siddiqlm commented 4 years ago

I used 'bcryptjs' module instead of 'bcrypt' module. It just worked fine. What error you are getting?

edelmacias commented 4 years ago

for anyone having this error, just change const bcrypt = require("bcrypt"); for const bcrypt = require("bcryptjs"); and npm i bcryptjs --save

hallonmunken commented 3 years ago

const bcrypt = require("bcryptjs");

Thank you @EdelMacias

shajin-sha commented 2 years ago

for anyone having this error, just change const bcrypt = require("bcrypt");for const bcrypt = require("bcryptjs"); and npm i bcryptjs --save

Thank you @EdelMacias

gideao-domingos commented 2 years ago

Install node-gyp package globally npm i -g node-gyp

and then retry

npm i bcrypt

in my case its work