javascript - NodeJS - 错误 : The specified procedure could not be found. bcrypt_lib.node

标签 javascript node.js express bcrypt

我已从 Node.js 0.12.7 升级到 4.2.1,启动服务器时出现以下错误:

$ node server.js
C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\node_modules\bindings\bindings.js:83
        throw e
        ^

Error: The specified procedure could not be found.
\\?\C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\build\Release\bcrypt_lib.node
    at Error (native)
    at Object.Module._extensions..node (module.js:460:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at bindings (C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\node_modules\bindings\bindings.js:76:44)
    at Object.<anonymous> (C:\Users\me\documents\github\angular-express-auth\node_modules\bcrypt\bcrypt.js:3:35)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\me\documents\github\angular-express-auth\server\config\mongo_database.js:2:14)
    at Module._compile (module.js:435:26)

事实上,node-gyp 构建失败导致了这个特定问题,反之亦然,不确定两者到底是如何链接的。在 Node.js 版本升级之前,它工作得很好。我安装了依赖项(Python v2.7.3,Microsoft Visual c++ 2015),也正确设置了环境变量。请帮忙。

最佳答案

这是node js和bcrypt模块版本不匹配的问题。在我的项目中使用 npm 卸载了 bcrypt 并重新安装了它,现在它成功构建了 node-gyp 模块(bcrypt 安装总是构建 node-gyp 并创建一个新的绑定(bind)文件)并且应用程序正在运行。

关于javascript - NodeJS - 错误 : The specified procedure could not be found. bcrypt_lib.node,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33396631/

相关文章:

javascript - setTimeout - 回调参数必须是一个函数

javascript - 无法读取我的 API 或特定 API [React.js/Node.js/Axios/Fetch]

javascript - 从 POST 请求中解析 req.body

node.js - 使用两个不同异步函数的结果

javascript - postman 回复 : Could not get any response from server

java - 如何在javascript数组中设置jsp变量?

javascript - typescript 导入自

javascript - 在点击 react 时切换 Font Awesome 图标

javascript - Nodejs/express 应用程序的 POST 404

javascript - 如何修复 'Uncaught SyntaxError: Unexpected token <'