Node - 使用 NODE_MODULE_VERSION 51 针对不同的 Node.js 版本进行编译 [英] Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51

查看:63
本文介绍了Node - 使用 NODE_MODULE_VERSION 51 针对不同的 Node.js 版本进行编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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?

解决方案

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 - 使用 NODE_MODULE_VERSION 51 针对不同的 Node.js 版本进行编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆