一、问题描述:
@inigolabs/ref-napi: Command failed. Exit code: 2
分析:该问题是由于im_electron_sdk 2.0.9版本依赖的@inigolabs/ref-napi最新版4.1.0引起:
both
@inigolabs/*-napi
were updated and i got an issue with them, they wont build with error@inigolabs\ref-napi: Command failed. Exit code: 2 Command: PYTHON=python3 node-gyp-build
. And changing dependencies versions doesnt help, until you set resolutions in package.json (if use yarn, or overrides if npm). Because@inigolabs\ref-napi
inside, in own node_modules have downloaded latest version of@inigolabs/ref-napi
, that have issue with building too.
二、解决方案:
在package.json中配置:
"resolutions": {
"@inigolabs/ffi-napi": "4.0.7",
"@inigolabs/ref-napi": "4.0.4"
},
详细可参阅:
https://github.com/node-ffi-napi/node-ffi-napi/issues/225