gpt4 book ai didi

node.js - Node - 使用 NODE_MODULE_VERSION 51 针对不同的 Node.js 版本进行编译

转载 作者:IT老高 更新时间:2023-10-28 21:49:00 25 4
gpt4 key购买 nike

我正在终端上运行 Node 应用程序。最近升级到 Node v8.5.0,但出现此错误:

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)

知道如何解决这个问题吗?

最佳答案

您需要从 node_modules 文件夹中删除模块文件夹 (bcrypt) 并重新安装,使用以下命令:

$ rm -rf node_modules/bcrypt
$ npm install
// or
$ yarn

关于node.js - Node - 使用 NODE_MODULE_VERSION 51 针对不同的 Node.js 版本进行编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46384591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com