我有一个快速的js应用程序。我想在服务器上一致地运行它。所以我用了PM2。当我在登台环境中运行该应用程序时,它运行良好。但是当我在生产服务器上运行它时,会出现以下错误:
Error: The module '/node_modules/bcrypt/lib/binding/bcrypt_lib.node'
0|server | was compiled against a different Node.js version using
0|server | NODE_MODULE_VERSION 57. This version of Node.js requires
0|server | NODE_MODULE_VERSION 67. Please try re-compiling or re-installing
0|server | the module (for instance, using `npm rebuild` or `npm install`).
0|server | at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)
0|server | at Module.load (internal/modules/cjs/loader.js:812:32)
0|server | at Function.Module._load (internal/modules/cjs/loader.js:724:14)
0|server | at Module.require (internal/modules/cjs/loader.js:849:19)
0|server | at Module.Hook._require.Module.require (/home/iron/.nvm/versions/node/v13.1.0/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:39)
0|server | at require (internal/modules/cjs/helpers.js:74:18)
0|server | at Object.<anonymous> (/home/iron/Documents/chat-api-stg/node_modules/bcrypt/bcrypt.js:6:16)
0|server | at Module._compile (internal/modules/cjs/loader.js:956:30)
0|server | at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
0|server | at Module.load (internal/modules/cjs/loader.js:812:32)
Versions:
node v13.1.0
nvm v0.32.1
npm v6.12.1
pm2 v4.1.2
在v2.7.12的两个环境中都安装了python。
任何帮助将不胜感激。
谢谢!