npm安装失败并出现gyp构建错误

时间:2014-06-02 13:11:51

标签: node.js git npm

我一直试图让节点和git为我正在努力的网络项目工作而没有任何运气。

我已从他们的网站安装了节点。当我尝试在我正在处理的git项目上执行npm install时,它给出了以下错误

C:\Users\Jibran\Desktop\ekhadim\ekhadimweb>npm install
npm http GET https://registry.npmjs.org/bcrypt
npm http 304 https://registry.npmjs.org/bcrypt
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> bcrypt@0.7.8 install C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\b
crypt
> node-gyp rebuild


C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt>node "C:\Program
Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\
node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform
.Targets(23,7): error MSB8007: The Platform for project 'bcrypt_lib.vcxproj' is
 invalid.  Platform='x64'. You may be seeing this message because you are tryin
g to build a project without a solution file, and have specified a non-default
Platform that doesn't exist for this project. [C:\Users\Jibran\Desktop\ekhadim\
ekhadimweb\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 (C:\Program Files\nodejs\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:807:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\node_modules\bcrypt
gyp ERR! node -v v0.10.28
gyp ERR! node-gyp -v v0.13.1
gyp ERR! not ok
npm ERR! bcrypt@0.7.8 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bcrypt@0.7.8 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
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\Users\Jibran\Desktop\ekhadim\ekhadimweb
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Jibran\Desktop\ekhadim\ekhadimweb\npm-debug.log
npm ERR! not ok code 0

我已经安装了python,VC ++ 2008和2010以及OpenSSL但是没有任何东西对我有用。

任何帮助将不胜感激。

由于 Jibran

2 个答案:

答案 0 :(得分:3)

安装Windows构建工具对我有用:

npm install --global --production windows-build-tools

关注:https://github.com/nodejs/node-gyp#installation

答案 1 :(得分:0)

安装 windows-build-tools 对我不起作用。诀窍是直接下载和安装Python。