节点-使用NODE_MODULE_VERSION 51针对不同的Node.js版本进行了编译 [英] Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51
本文介绍了节点-使用NODE_MODULE_VERSION 51针对不同的Node.js版本进行了编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在终端上运行节点应用程序.最近已升级到节点v8.5.0,但出现此错误:
I am running a node application on terminal. Have recently upgraded to node v8.5.0, but am getting this error:
Error: The module '/tidee/tidee-au/packages/tidee-au-server/node_modules/bcrypt/lib/binding/bcrypt_lib.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 51. This version of Node.js requires
NODE_MODULE_VERSION 57. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (module.js:653:18)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/tidee/tidee-au/packages/tidee-au-server/node_modules/bcrypt/bcrypt.js:6:16)
at Module._compile (module.js:624:30)
at Module._extensions..js (module.js:635:10)
at Object.require.extensions.(anonymous function) [as .js] (/tidee/tidee-au/packages/tidee-au-server/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/tidee/tidee-au/packages/tidee-au-server/server/helpers/encryptPass.js:1:16)
有什么办法解决这个问题吗?
Any idea how to solve this?
推荐答案
您需要从node_modules
文件夹中删除模块文件夹(bcrypt
)并重新安装,请使用以下命令:
You need to remove the module folder (bcrypt
) from the node_modules
folder and reinstall it, use the following commands:
$ rm -rf node_modules/bcrypt
$ npm install
// or
$ yarn
这篇关于节点-使用NODE_MODULE_VERSION 51针对不同的Node.js版本进行了编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文