栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

安装电子模块时,节点模块版本冲突

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

安装电子模块时,节点模块版本冲突

当发生这种类型的版本不匹配时,您可以选择具有目标Node版本的电子分布,也可以重建npm软件包。由于Electron的发行版已跳过使用NODE_MODULE_VERSION
51配置的Node v7.0.0(并跳至v7.4.0),因此您必须重新构建

serialport
软件包。

在您应用的目录(package.json所在的目录)中,

1.安装

electron-rebuild

npm install --save-dev electron-rebuild

2.重建

./node_modules/.bin/electron-rebuild

或者,甚至是更好的选择 -首先设置环境变量。

# Electron's version.export npm_config_target=1.6.1# The architecture of Electron, can be ia32 or x64.export npm_config_arch=x64export npm_config_target_arch=x64# Download headers for Electron.export npm_config_disturl=https://atom.io/download/electron# Tell node-pre-gyp that we are building for Electron.export npm_config_runtime=electron# Tell node-pre-gyp to build module from source pre.export npm_config_build_from_source=true# Install all dependencies, and store cache to ~/.electron-gyp.HOME=~/.electron-gyp npm install

查看有关使用本机节点模块的Electron的文档页面。 https://electron.atom.io/docs/tutorial/using-
native-node-modules/



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/383931.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号