我已从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),也正确设置了环境变量。请帮忙。
答案 0 :(得分:3)
这是节点js和bcrypt模块之间版本不匹配的问题。在我的项目中使用npm卸载了bcrypt并重新安装了它,现在它已经成功构建了node-gyp模块(bcrypt安装总是构建node-gyp并创建一个新的绑定文件)并且应用程序正在运行。