gpt4 book ai didi

npm - Electron 5.1.0的ZeroMQ重建失败,错误为MSB4019 : The imported project “C:\Microsoft.Cpp.Default.props” was not found

转载 作者:行者123 更新时间:2023-12-03 12:43:17 25 4
gpt4 key购买 nike

我正在尝试将ZeroMQ安装到 Electron 应用程序中,但无法重建 Electron 包装。

我正在尝试在Windows 10计算机上为 Electron 版5.1.0安装ZeroMQ。细节:

作业系统:Windows 10
Electron :5.0.8
节点:12.0.0

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

1)使用npm安装zeromqnpm install zeromq
2)重建 Electron npm rebuild zeromq --runtime=electron --target=5.1.0注意:文档指出此处的目标应该是 Electron 版本;但是,这会导致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)安装Visual Studio构建工具npm install --global --production windows-build-tools此命令已成功完成,并安装了构建工具和python2.7

4)在步骤2中重新运行rebuild命令会导致相同的错误。我尝试了以下命令的变体: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)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.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>\path\to\app\node_modules\zeromq
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>\path\to\app\node_modules\zeromq\build\zmq.vcxproj]
具有与其他年份相似的结尾部分。

最佳答案

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

关于npm - Electron 5.1.0的ZeroMQ重建失败,错误为MSB4019 : The imported project “C:\Microsoft.Cpp.Default.props” was not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57400027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com