为 Atom 开发包时节点模块版本冲突
Node module version conflict while developing package for Atom
我正在为 Atom 开发我的第一个包。为此,我需要这个包 nodegit
(here the official website).
当我尝试 运行 我的包裹时,我得到这个错误:
The module '/Users/danny/github/branch-control/node_modules/nodegit/build/Release
/nodegit.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
我已经尝试在线查看,但我找到的 none 解决方案解决了我的问题。
我尝试使用 npm rebuild
、npm rebuild nodegit
,我尝试使用 --update-binary
安装它,我尝试使用不同的节点版本,但没有成功。
而且上面说NODE_MODULE_VERSION 69
,但是node releases里没有版本69
,直接从64
到72
。
我在网上查到这个69
指的是electron用的node版本,但是我觉得改不了,因为是Atom用的版本
我该如何解决这个问题并继续?
这是我的环境:
- macOS 卡特琳娜 10.15
- 凌动 1.44.0
- 电子 4.2.7
- Chrome69
- 节点 10.11.0
您需要为此使用 electron-rebuild。
来自自述文件:
This executable rebuilds native Node.js modules against the version of Node.js that your Electron project is using. This allows you to use native Node.js modules in Electron apps without your system version of Node.js matching exactly (which is often not the case, and sometimes not even possible).
我正在为 Atom 开发我的第一个包。为此,我需要这个包 nodegit
(here the official website).
当我尝试 运行 我的包裹时,我得到这个错误:
The module '/Users/danny/github/branch-control/node_modules/nodegit/build/Release
/nodegit.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 69. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
我已经尝试在线查看,但我找到的 none 解决方案解决了我的问题。
我尝试使用 npm rebuild
、npm rebuild nodegit
,我尝试使用 --update-binary
安装它,我尝试使用不同的节点版本,但没有成功。
而且上面说NODE_MODULE_VERSION 69
,但是node releases里没有版本69
,直接从64
到72
。
我在网上查到这个69
指的是electron用的node版本,但是我觉得改不了,因为是Atom用的版本
我该如何解决这个问题并继续?
这是我的环境:
- macOS 卡特琳娜 10.15
- 凌动 1.44.0
- 电子 4.2.7
- Chrome69
- 节点 10.11.0
您需要为此使用 electron-rebuild。
来自自述文件:
This executable rebuilds native Node.js modules against the version of Node.js that your Electron project is using. This allows you to use native Node.js modules in Electron apps without your system version of Node.js matching exactly (which is often not the case, and sometimes not even possible).