初学node.js,尝试运行node.js in action的代码出现了无法安装bcrypt module的问题,按照http://henzil.easymorse.com/?p=510 操作后还是有问题,希望能得到解答,十分感谢!
D:\node\nodejsinaction\9\shoutbox>npm install bcrypt npm http GET https://registry.npmjs.org/bcrypt/0.7.3 npm http 304 https://registry.npmjs.org/bcrypt/0.7.3 npm http GET https://registry.npmjs.org/bindings/1.0.0 npm http 304 https://registry.npmjs.org/bindings/1.0.0
bcrypt@0.7.3 install D:\node\nodejsinaction\9\shoutbox\node_modules\bcrypt node-gyp rebuild
D:\node\nodejsinaction\9\shoutbox\node_modules\bcrypt>node “D:\node_modules\npm
bin\node-gyp-bin\…\node_modules\node-gyp\bin\node-gyp.js” rebuild
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: 项目“bcrypt_lib.vcxproj”的平台无效。平台为“x64
”。您会看到此消息的可能原
因是,您尝试在没有解决方案文件的情况下生成项目,并且为此项目指定了并不存在的非默
认平台。 [D:\node\nodejsinaction\9\shoutbox
\node_modules\bcrypt\build\bcrypt_lib.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\node_modules\npm\node_modules\node
-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command “node” “D:\node_modules\npm\node_modules\node-gyp\bin\nod
e-gyp.js” "rebuild"
gyp ERR! cwd D:\node\nodejsinaction\9\shoutbox\node_modules\bcrypt
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok
npm ERR! bcrypt@0.7.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.3 install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
现在解决了没有,windows下c++真的是让人头疼。已经装了几次了都是不成功的。但是我们公司又没给我们配置更高的版本,心里无明的怒火。
换掉windows。。。
我用Ubuntu安装上了,stackoverflow上说要安装vs2015, 我本身就安装了编译还是出错,果断采用Linux
我安装的是vs2013,使用下面命令安装成功: npm install -g bcrypt --msvs_version=2013 虽然有些警告,但是无视之。
怎么这么多版本…一个说12 13 15 10
@cjz9032 我win10当初也是这种情况,后来看教程我安装了Python2.7 还安装了vs2015社区版, 然后就好了 自豪地采用 CNodeJS ionic