该模块(bcrypt)是针对Azure Web Server上的另一个Node.js版本编译的

Phi*_*p S 5 backend azure node.js node-modules

我有一个使用bcrypt库的节点项目。当我将其部署到Azure时(在我的本地计算机上运行良好,并且我的计算机和Azure服务器都在运行Node 10.7.0),对于每个请求,我都会收到HTTP错误500。当我检查应用程序日志以了解问题所在时,这是我收到的完整错误消息(减去堆栈跟踪):

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`).
Run Code Online (Sandbox Code Playgroud)

我尝试了以下操作,但均未成功:

  1. 在两台计算机上都使用Node 8
  2. npm rebuild在Kudu调试控制台上运行
  3. node_modules从我的.gitignore中省略,并将机器的节点模块目录直接推到azure(是的,我很拼命)

我该如何解决?