The module (bcrypt) was compiled against a different Node.js version on Azure Web Server

Viewed 604

I have a node project that uses the bcrypt library. When I deploy it to Azure (it works fine on my local machine, and both my machine and the Azure server are running Node 10.7.0), I get HTTP error 500 back for every request. When I checked the application logs to see what was going wrong, this was the full error message I got (minus the stack trace):

Application has thrown an uncaught exception and is terminated:
Error: The module '\\?\D:\home\site\wwwroot\node_modules\bcrypt\lib\binding\bcrypt_lib.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

I have tried the following things with no success:

  1. Using Node 8 instead on both machines
  2. Running npm rebuild on the Kudu debug console
  3. Omitting node_modules from my .gitignore and pushing my machine's node modules directory straight to azure (yeah, I got desperate)

How can I resolve this?

0 Answers
Related