Sit*_*thu 7 windows-7 node.js node-gyp
我找到了许多答案,就像这个问题,但所有这些都无法解决我的问题.这是我安装的版本:
node 0.10.31
npm 1.4.23
node-gyp 0.10.31
bcrypt 0.7.8
Run Code Online (Sandbox Code Playgroud)
我在package.json中有依赖"bcrypt": "0.7.x".这是我的一步一步:
npm installgyp ERR! stack Error: Can't find Python executable "python", you can
set the PYTHON env variable.
Run Code Online (Sandbox Code Playgroud)
我不得不安装Python 2.7.*
npm installMSBUILD : error MSB3428: Could not load the Visual C++ component
"VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK,
2) install Microsoft Visual Studio 2005 or 3) add the location of the
component to the system path if it is installed elsewhere.
Run Code Online (Sandbox Code Playgroud)
我不得不安装Visual Studio 2008(Professional),这是我手中唯一的.我C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages在vcbuild.exe中添加了PATH变量.
npm install再次运行VCBUILD : error Message: [D:\...\node_modules\bcrypt\build\binding.sln]
VCBUILD : System error : -2147154687. [D:\...\node_modules\bcrypt\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe`
failed with exit code: 1
Run Code Online (Sandbox Code Playgroud)
它似乎使用.NET 4而失败了.我有六个.NET框架文件夹C:\Windows\Microsoft.NET\Framework,它似乎使用最新的:
npm install --msvs_version=2008与(2)相同的错误.
npm install --msvs_version=2012错误改变了一点.
D:\...\node_modules\bcrypt\build\bcrypt_lib.vcxproj(18,3): error MSB4019: The imported
project "D:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the
<Import> declaration is correct, and that the file exists on disk.
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe`
failed with exit code: 1
Run Code Online (Sandbox Code Playgroud)
D:\...\node-proj>node-gyp rebuild --msvs_version=2008
'node-gyp' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
对此有什么想法吗?
我按照node-gyp的Windows安装步骤进行操作,安装Microsoft Visual Studio C++ 2010 Express解决了这个问题,除了一些警告.我确实看到了在控制台消息中创建的库.

构建过程似乎在寻找[Drive]:\Program Files\Microsoft Visual Studio 10.0\VC\vcpackages\vcbuild.dllVisual Studio C++ 2010 Express安装的过程.
首先,我为Windows桌面安装了Microsoft Visual Studio C++ 2012/13,这是Windows7/8的要求之一.但它实际上并不起作用,对于Windows 7来说并不是必需的.
Windows 7 32位的node-gyp要求(Windows 7/8 64位可能有不同的要求):
这不仅要求bcrypt,而且需要使用node-gyp构建所有节点模块.如果检查模块的配置文件,您将看到其要求,例如,您可以检查以下文件:
\node_modules\bcrypt\build\binding.sln\node_modules\bcrypt\build\config.gypi| 归档时间: |
|
| 查看次数: |
9198 次 |
| 最近记录: |