我正在尝试在Windows 7 64bit上安装Dnode,Microsoft Visual C 2010 Express和Python 2.7.3已安装。我从NPM获得以下输出:
C:Program Filesnodejs>npm install dnode
npm http GET https://registry.npmjs.org/dnode
npm http 304 https://registry.npmjs.org/dnode
npm http GET https://registry.npmjs.org/jsonify
npm http GET https://registry.npmjs.org/weak
npm http GET https://registry.npmjs.org/dnode-protocol
npm http 304 https://registry.npmjs.org/jsonify
npm http 304 https://registry.npmjs.org/weak
npm http 304 https://registry.npmjs.org/dnode-protocol
npm http GET https://registry.npmjs.org/traverse
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/traverse
> weak@0.2.1 install C:Program Filesnodejsnode_modulesdnodenode_modulesweak
> node-gyp rebuild
C:Program Filesnodejsnode_modulesdnodenode_modulesweak>node "C:Program Filesnodejsnode_modulesnpmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild
C:Program Files (x86)MSBuildMicrosoft.Cppv4.0Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'weakref.vcxproj' is invalid. Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [C:Program Filesnodejsnode_modulesdnodenode_modulesweakbuildweakref.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:WindowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibbuild.js:236:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:Program Filesnodejsnode_modulesdnodenode_modulesweak
gyp ERR! node -v v0.8.14
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm ERR! weak@0.2.1 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the weak@0.2.1 install script.
npm ERR! This is most likely a problem with the weak 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 weak
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7600
npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "dnode"
npm ERR! cwd C:Program Filesnodejs
npm ERR! node -v v0.8.14
npm ERR! npm -v 1.1.65
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:Program Filesnodejsnpm-debug.log
npm ERR! not ok code 0
C:Program Filesnodejs>python -- version
Python 2.7.3
命令提示符以管理员的身份运行。
"项目'feekref.vcxproj'的平台无效。"?这是32位/64位问题吗?
这似乎是C 编译器的问题。因此,我安装了.NET的完整64位版本
现在正在尝试安装DVD的Microsoft Windows SDK和Windows 7(ISO)4(ISO):x64 ISO文件grmsdkx_en_dvd.iso来自http://www.microsoft.com/en-us/download/details.aspx?id=8442
但是安装失败,带有以下错误:请参阅samples setup html configdetails.htm文档。
然后,我在设置注册表后再次尝试并根据此处的建议验证TEM变量:http://ctrlf5.net/?p=184
再次,SDK不会安装
有什么想法在这里出了什么问题以及如何解决?
我在论坛上找到了一个答案,该论坛指出了节点GYP安装说明。因此,Windows Visual C 是需要2010年(Express Edition可以)也需要Windows 7 64位SDK。
请注意此故障排除提示:"如果安装失败,请尝试卸载任何C 2010 x64& x86您先安装的可重新分配。"
我实际上遇到了这个问题,并通过卸载我的Visual C 2010 x64& x86 Redistibutables,然后安装Windows 7 64位SDK来修复它。然后,我能够构建节点GYP,依此多待地执行" NPM安装dnode"。