在 node.js 上安装串行端口时出错
Error installing serialport on node.js
我 运行ning windows 10 节点 4.2.2。我正在尝试设置与我的 arduino 一起工作,但我一直 运行 遇到安装串行端口的问题。我找不到任何帮助。这些是我在 运行 npm install serialport
时得到的错误
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "serialport" "-g"
npm ERR! node v4.2.2
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! serialport@2.0.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.2 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! c:\Users\john\Desktop\node-ardx\node_modules\johnny-five\npm-debug.log
确保安装了 Python 2.7。如果这样做,则可能是 C++ 编译器的问题。
安装 Microsoft Build Tools 2015 (https://www.microsoft.com/en-us/download/details.aspx?id=48159)
然后,在 cmd 行上将默认编译器更改为 VS2015 :
$ npm config set msvs_version 2015
并且要特别确定:
$ set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
如果您现在尝试安装串行端口,您会收到一些黄色警告,但安装没有任何问题。
干杯!
我 运行ning windows 10 节点 4.2.2。我正在尝试设置与我的 arduino 一起工作,但我一直 运行 遇到安装串行端口的问题。我找不到任何帮助。这些是我在 运行 npm install serialport
时得到的错误npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "serialport" "-g"
npm ERR! node v4.2.2
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! serialport@2.0.2 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.2 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! c:\Users\john\Desktop\node-ardx\node_modules\johnny-five\npm-debug.log
确保安装了 Python 2.7。如果这样做,则可能是 C++ 编译器的问题。 安装 Microsoft Build Tools 2015 (https://www.microsoft.com/en-us/download/details.aspx?id=48159) 然后,在 cmd 行上将默认编译器更改为 VS2015 :
$ npm config set msvs_version 2015
并且要特别确定:
$ set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
如果您现在尝试安装串行端口,您会收到一些黄色警告,但安装没有任何问题。
干杯!