Electron 5.1.0 的 ZeroMQ 重建失败,错误 MSB4019:找不到导入的项目"C:Microsoft.Cpp.Default.props"



我正在尝试将ZeroMQ安装到电子应用程序中,但我无法为电子重建软件包。

我正在尝试在我的Windows 5.10机器上安装电子5.1.0的ZeroMQ。详:

操作系统: 视窗 10 电子:5.0.8 节点:12.0.0

按照 README.md https://github.com/zeromq/zeromq.js/中的说明,我遵循了以下程序:

1( 使用 npm 安装 zeromqnpm install zeromq

2(重建电子npm rebuild zeromq --runtime=electron --target=5.1.0注意:文档表明这里的目标应该是电子版本;但是,这会导致 404 错误,因为 npm 尝试转到不存在 https://nodejs.org/dist/v5.0.8/node-v5.0.8-headers.tar.gz。然后我想尝试节点版本,但这会导致 401 错误。然后我尝试了导致此错误的 zeromq 版本(命令中所示的 5.1.0(:

error MSB4019: The imported project "C:Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

谷歌搜索这个错误会带来很多需要构建工具的StackOverflow问题。在 README.md 上向前看一点,使我找到了可以使用下一个命令解决此问题的事情。

3( 安装视觉工作室构建工具npm install --global --production windows-build-tools此命令成功完成并安装构建工具和 python2.7

4( 重新运行步骤 2 中的重建命令会导致相同的错误。我尝试了此命令的变体:npm config set msvs_version 2013也使用 2015 和 2017。

2013 和 2015 给出此错误:error MSB4019: The imported project "C: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:Program Files (x86)MSBuild14.0binmsbuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:Program Filesnodejsnode_modulesnpmnode_modulesnode-gyplibbuild.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Windows_NT 10.0.17134 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd C:Users<user>pathtoappnode_moduleszeromq gyp ERR! node -v v10.16.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! zeromq@5.1.0 install: node scripts/prebuild-install.js || (node scripts/preinstall.js && node-gyp rebuild) npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the zeromq@5.1.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

虽然2017年给出了这个:error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 bui ld tools, please install v140 build tools. Alternatively, you may upgrade to the current Visual Studio tools by select ing the Project menu or right-click the solution, and then selecting "Retarget solution". [C:Users<user>pathtoappnode_moduleszeromqbuildzmq.vcxproj]结尾部分与其他年份相似。

最后,这是一个Visual Studio build工具安装错误。我使用Visual Studio安装程序卸载了Visual Studio,然后重新安装了windows-build-tools。

最新更新