Closed Gavin-YYC closed 3 years ago
It's worked for me:
Update:
node(32): 12.18.3
electron: 11.4.7
wianx: 3.1.4
also try new fix winax@3.1.4
I try with version 3.1.4.
OS: Windows_NT x64 10.0.19042
wianx: 3.1.4
node(32): 12.18.3
npm: 6.14.6
electron: 12.0.6
Package.json:
{
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"start": "npm run build && electron ./dist/app"
},
"dependencies": {
"winax": "^3.1.4"
},
"devDependencies": {
"@types/node": "^15.0.2",
"electron": "^12.0.6",
"electron-rebuild": "^2.3.5",
"ts-node-dev": "^1.1.6",
"typescript": "^4.2.4"
}
}
1、Install and start
npm i
npm run start
I got those error message:
App threw an error during load
Error: The module '\\?\C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 87. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12684)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\xxx\Desktop\fuzhu\node_modules\winax\activex.js:1:32)
at Module._compile (internal/modules/cjs/loader.js:1078:30)
C:\Users\xxx\Desktop\fuzhu\node_modules\electron\dist\electron.exe exited with signal SIGINT
2、Rebuild with npm rebuild
npm rebuild winax --runtime=electron --target=12.0.6 --dist-url=https://electronjs.org/headers --build-from-source
I got those error message:
$ npm rebuild winax --runtime=electron --target=12.0.6 --dist-url=https://electronjs.org/headers --build-from-source
> winax@3.1.4 install C:\Users\xxx\Desktop\fuzhu\node_modules\winax
> node-gyp rebuild
C:\Users\xxx\Desktop\fuzhu\node_modules\winax>if not defined npm_config_node_gyp (node "D:\soft\nvm\v12.18.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\soft\nvm\v12.18.3\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
main.cpp
utils.cpp
disp.cpp
win_delay_load_hook.cc
C:\Users\xxx\AppData\Local\node-gyp\Cache\12.0.6\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback (????? ..\src\disp.cpp) [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
C:\Users\xxx\AppData\Local\node-gyp\Cache\12.0.6\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback (????? ..\src\main.cpp) [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
C:\Users\xxx\AppData\Local\node-gyp\Cache\12.0.6\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback (????? ..\src\utils.cpp) [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
????? C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.lib ??? C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.exp
disp.obj : error LNK2019: ????????? "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __thiscall v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuf
fer@v8@@QAE?AV?$shared_ptr@VBackingStore@v8@@@std@@XZ),?? "private: static void __cdecl DispObject::NodeCreate(class v8::FunctionCallbackInfo<class v8::Value> const &)" (?NodeCreate@DispObject@@CA
XABV?$FunctionCallbackInfo@VValue@v8@@@v8@@@Z) ??????? [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.node : fatal error LNK1120: 1 ?????????? [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vc
xproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\soft\nvm\v12.18.3\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\soft\\nvm\\v12.18.3\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\xxx\Desktop\fuzhu\node_modules\winax
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! winax@3.1.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the winax@3.1.4 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! C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2021-05-17T01_19_22_173Z-debug.lo
3、Try rebuild with electron-rebuild
./node_modules/.bin/electron-rebuild
I got the same error with step 2.
Error in macro definition NODE_MAJOR_VERSION See condition at src/dsip.cpp #if (NODE_MAJOR_VERSION >= 14)
I can't understand why --target=12.0.6? In my case execute command rebuild winax --runtime=electron --target=12.0.6 --dist-url= https://electronjs.org/headers --build-from-source Gives download error Error: 404 response downloading https://nodejs.org/dist/v12.0.6/node-v12.0.6-headers.tar.gz Which is logical, this is invalid node.js version!? Why not use 14.16.0 for electron 12.0.6? [image: image.png]
пн, 17 мая 2021 г. в 04:32, 杨友存 @.***>:
I try with version 3.1.4.
OS: Windows_NT x64 10.0.19042
wianx: 3.1.4
node(32): 12.18.3
npm: 6.14.6
electron: 12.0.6
Package.json:
{
"scripts": { "build": "tsc", "watch": "tsc -w", "start": "npm run build && electron ./dist/app" }, "dependencies": { "winax": "^3.1.4" }, "devDependencies": { ***@***.***/node": "^15.0.2", "electron": "^12.0.6", "electron-rebuild": "^2.3.5", "ts-node-dev": "^1.1.6", "typescript": "^4.2.4" }
}
1、Install and start
npm i
npm run start
I got those error message:
App threw an error during load
Error: The module '\?\C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 87. Please try re-compiling or re-installing
the module (for instance, using
npm rebuild
ornpm install
).at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846) at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18) at Object.func [as .node] (electron/js2c/asar_bundle.js:5:1846) at Module.load (internal/modules/cjs/loader.js:935:32) at Module._load (internal/modules/cjs/loader.js:776:14) at Function.f._load (electron/js2c/asar_bundle.js:5:12684) at Module.require (internal/modules/cjs/loader.js:959:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (C:\Users\xxx\Desktop\fuzhu\node_modules\winax\activex.js:1:32) at Module._compile (internal/modules/cjs/loader.js:1078:30)
C:\Users\xxx\Desktop\fuzhu\node_modules\electron\dist\electron.exe exited with signal SIGINT
2、Rebuild with npm rebuild
npm rebuild winax --runtime=electron --target=12.0.6 --dist-url=https://electronjs.org/headers --build-from-source
I got those error message:
$ npm rebuild winax --runtime=electron --target=12.0.6 --dist-url=https://electronjs.org/headers --build-from-source
@.*** install C:\Users\xxx\Desktop\fuzhu\node_modules\winax
node-gyp rebuild
C:\Users\xxx\Desktop\fuzhu\node_modules\winax>if not defined npm_config_node_gyp (node "D:\soft\nvm\v12.18.3\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\soft\nvm\v12.18.3\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
main.cpp
utils.cpp
disp.cpp
win_delay_load_hook.cc
C:\Users\xxx\AppData\Local\node-gyp\Cache\12.0.6\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback (????? ..\src\disp.cpp) [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
C:\Users\xxx\AppData\Local\node-gyp\Cache\12.0.6\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback (????? ..\src\main.cpp) [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
C:\Users\xxx\AppData\Local\node-gyp\Cache\12.0.6\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback (????? ..\src\utils.cpp) [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
????? C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.lib ??? C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.exp
disp.obj : error LNK2019: ????????? "__declspec(dllimport) public: class std::sharedptr
thiscall v8::ArrayBuffer::GetBackingStore(void)" (imp ?GetBackingStore@ArrayBuf@.@@QAE?AV?$shared_ptr@@.@@@std@@XZ),?? "private: static void __cdecl DispObject::NodeCreate(class v8::FunctionCallbackInfo
const &)" (?NodeCreate@DispObject@@CA XABV?$FunctionCallbackInfo@@.***@@@v8@@@Z) ??????? [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\Release\node_activex.node : fatal error LNK1120: 1 ?????????? [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vc
xproj]
gyp ERR! build error
gyp ERR! stack Error:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
failed with exit code: 1gyp ERR! stack at ChildProcess.onExit (D:\soft\nvm\v12.18.3\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.19042
gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\soft\nvm\v12.18.3\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\xxx\Desktop\fuzhu\node_modules\winax
gyp ERR! node -v v12.18.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @.*** install:
node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @.*** 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! C:\Users\xxx\AppData\Roaming\npm-cache_logs\2021-05-17T01_19_22_173Z-debug.lo
3、Try rebuild with electron-rebuild
./node_modules/.bin/electron-rebuild
I got the same error with step 2.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/durs/node-activex/issues/94#issuecomment-841918964, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEMMNNO5LHPRWAWRFSZMEDTOBW3JANCNFSM44Y5ID2Q .
I can't understand why --target=12.0.6?
I think I have a wrong understanding of the electron version referred to in the readme file. Is it not the electron version but the NodeJS version in the electron?
basic info:
error info: