electron 使用 node-serialport 报错
按照了这个库https://github.com/johnny-fiv...的步骤走了,报 ETIMEDOUT 54.231.72.187:443, 查了挺多方法,搞不定
接入其他node模块,比如 node-usb ,也出现同样的问题。
这里有提到点,做了 rebuild 也保不定 https://github.com/electron/e...
能知道是网络问题,但是怎么处理这个网络问题,求答案。高价有偿解答,私信我加微信
> electron-quick-start@1.0.0 install /Users/liyatang/github/electron-quick-start
> electron-rebuild
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT 54.231.72.187:443
gyp ERR! stack at Object.exports._errnoException (util.js:1026:11)
gyp ERR! stack at exports._exceptionWithHostPort (util.js:1049:20)
gyp ERR! stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1136:14)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/liyatang/github/electron-quick-start/node_modules/.bin/node-gyp" "rebuild" "--target=1.6.11" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=serialport" "--module_path=/Users/liyatang/github/electron-quick-start/node_modules/serialport/build/Release" "--host=https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7"
gyp ERR! cwd /Users/liyatang/github/electron-quick-start/node_modules/serialport
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Failed with exit code: 1
Error: gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT 54.231.72.187:443
gyp ERR! stack at Object.exports._errnoException (util.js:1026:11)
gyp ERR! stack at exports._exceptionWithHostPort (util.js:1049:20)
gyp ERR! stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1136:14)
gyp ERR! System Darwin 16.5.0
gyp ERR! command "/usr/local/bin/node" "/Users/liyatang/github/electron-quick-start/node_modules/.bin/node-gyp" "rebuild" "--target=1.6.11" "--arch=x64" "--dist-url=https://atom.io/download/electron" "--build-from-source" "--module_name=serialport" "--module_path=/Users/liyatang/github/electron-quick-start/node_modules/serialport/build/Release" "--host=https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7"
gyp ERR! cwd /Users/liyatang/github/electron-quick-start/node_modules/serialport
gyp ERR! node -v v8.0.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是我代理问题,把ss改成全局模式就ok了
问题是由于墙的问题吧,这样子可以完成安装。
我用mac的可以在.bash_profile中export这个变量,然后就直接npm install electron就可以了。