我正在尝试在 Windows 7(64 位)机器上安装 phantomjs-node 模块。安装“弱”模块时似乎出现了 node-gyp 重建错误。
我已经关注了 node-gyp windows installation steps并确保我安装了 python 并正确设置了它的路径。
我还有 visual c++ 和 node-gyp 所需的其他要求。遗憾的是我无法修复 node-gyp 重建错误。
我有以下安装
- Node - 0.8.14(64 位)
- python - 2.7.3(64 位)
- Microsoft Visual C++ 2010(64 位,还安装了 32 位以防万一,因为 64 位没有帮助)
- Visual Studio 2010 (Pro) 和 Visual Studio 2012(Express,Web 和桌面)
- Windows SDK 7.1
我在安装 weak 模块时不断遇到的错误是:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.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.
我遇到了上述问题,尝试了所有链接并正确安装了所有 node-gyp 要求。非常感谢帮助。
最佳答案
几天来我一直在寻找这个答案,但上面的修复对我不起作用。
我发现的解决方案非常有效: Cannot install node modules that require compilation on Windows 7 x64/VS2012
npm install phantom -msvs_version=2012
关于node.js - 在 Windows 7 上为 phantomjs 安装 "weak"模块时,node-gyp 重建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20628345/