[英]node-gyp build error for bcrypt module in Windows_NT 6.1.7600 (x86)
我找到了許多答案,就像這個問題,但所有這些都無法解決我的問題。 這是我安裝的版本:
node 0.10.31
npm 1.4.23
node-gyp 0.10.31
bcrypt 0.7.8
我在package.json "bcrypt": "0.7.x"
有依賴"bcrypt": "0.7.x"
。 這是我的一步一步:
npm install
gyp ERR! stack Error: Can't find Python executable "python", you can
set the PYTHON env variable.
我不得不安裝Python 2.7。*
npm install
MSBUILD : 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.
我不得不安裝Visual Studio 2008(Professional),這是我手中唯一的。 我在vcbuild.exe中添加了PATH變量C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\vcpackages
。
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
它似乎使用.NET 4而失敗了。 我在C:\\Windows\\Microsoft.NET\\Framework
有六個.NET框架文件夾,它似乎使用了最新的一個:
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
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.
對此有什么想法嗎?
我按照node-gyp的Windows安裝步驟進行操作 ,安裝Microsoft Visual Studio C ++ 2010 Express解決了這個問題,除了一些警告。 我確實看到了在控制台消息中創建的庫。
構建過程似乎正在尋找由Visual Studio C ++ 2010 Express安裝的[Drive]:\\Program Files\\Microsoft Visual Studio 10.0\\VC\\vcpackages\\vcbuild.dll
。
首先,我為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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.