c++ - NPM 安装:找不到平台工具集 = v141
问题描述
我正在尝试安装此库Barcode-Scanner-npm但安装失败并显示此错误:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(57,5): error MSB8020: The build t
ools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 bui
ld tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-cli
ck the solution, and then selecting "Retarget solution". [C:\Users\bla\Desktop\bla\myProject\node_modules\@serialport\bin
dings\build\bindings.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` 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:258:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198: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\bla\Desktop\bla\myProject\node_modules\@serialport\bindings
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN myProject@1.0.0 No description
npm WARN myProject@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@2.0.2 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@2.0.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\bla\AppData\Roaming\npm-cache\_logs\2018-09-10T10_13_47_454Z-debug.log
我尝试了一些我在网上找到的解决方案,比如安装这个:
npm i windows-build-tools
但这对我不起作用。
我安装了 VS2017 以及 Platform Toolset v141,如您在此处看到的(最后一个复选框):VS17 Updater
解决方案
您可以尝试以这种方式安装 windows-build-tools
npm install --global --production windows-build-tools
推荐阅读
- dart - 如何在 Flutter 中为列表更改设置动画
- mysql - 如何对mysql中日期格式为%m/%d/%Y的列进行排序?
- android - Android 运行时 NoSuchMethodError
- arduino-uno - Ardulink 2 无法使用 Serial.print 从模拟 Pin1 接收消息
- c# - 如何更改在 Enterprise bot v4 中加密的 .Bot 文件中的 LUIS 订阅密钥
- apache-spark - 将 s3 中的大量 json 文件重新分区为镶木地板,而 EMR 需要很长时间
- javascript - 不必要的转义字符:\` no-useless-escape
- android - 超过工作管理器中的数据有效负载限制
- java - 从搜索结果(在片段中)获取数据并在选项卡布局中更新(其他)片段
- javascript - 改变 [].__proto__.constructor 和 [].constructor 的行为不同