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

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

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

当发生这种类型的版本不匹配时,您可以选择具有目标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/



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/4947199.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-13
下一篇 2022-11-13

发表评论

登录后才能评论

评论列表(0条)

保存