作者:老鼠扛着刀找猫_592 | 来源:互联网 | 2022-12-05 10:56
我有一个使用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`).
我尝试了以下操作,但均未成功:
在两台计算机上都使用Node 8
npm rebuild
在Kudu调试控制台上运行
node_modules
从我的.gitignore中省略,并将机器的节点模块目录直接推到azure(是的,我很拼命)
我该如何解决?