electron运行robotjs版本号不匹配

运行electron运行robotjs版本号不匹配问题解决

运行发现报错版本号不匹配,去降低node版本号,结果发现不是版本号问题

<project>/node_modules/robotjs/build/Release/robotjs.node' was compiled against a different Node.js version using 
NODE_MODULE_VERSION 57.
 This version of Node.js requires NODE_MODULE_VERSION 54. 
 Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install).

一顿操作下来又报错node-gyp构建错误

node-expat.3.18 install /usr/local/lib/nodejs/node-v14.0.0-linux-x64/lib/node_modules/rnv/node_modules/node-expat node-gyp rebuild

gyp ERR! clean error gyp ERR! stack Error: EACCES: permission denied, rmdir 'build' gyp ERR! System Linux 5.3.0-51-generic gyp ERR! command "/usr/local/lib/nodejs/node-v14.0.0-linux-x64/bin/node" "/usr/local/lib/nodejs/node-v14.0.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/local/lib/nodejs/node-v14.0.0-linux-x64/lib/node_modules/rnv/node_modules/node-expat gyp ERR! node -v v14.0.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/rnv/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN rnv.29.0 requires a peer of now.3.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-expat.3.18 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-expat.3.18 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/abhishek/.npm/_logs/2020-05-10T08_21_14_099Z-debug.log

解决办法重新删除项目重新npm执行以下命令能解决大部分问题
target是electron版本号

通过打印
console.info(process.versions);
查看
node和abi的对应关系:参见

cnpm rebuild --runtime=electron --target=8.5.5 --disturl=https://atom.io/download/atom-shell --abi=72
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

秋叶原的琴音

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值