durs / node-activex

Node.JS Implementaion of ActiveXObject
MIT License
329 stars 62 forks source link

rebuild error #94

Closed Gavin-YYC closed 3 years ago

Gavin-YYC commented 3 years ago

basic info:

{
  node: '12.18.3',
  module: 72,
}

{
  electron: '12.0.1',
  module: 87
}

error info:


PS C:\Users\xxx\Desktop\fuzhu> .\node_modules\.bin\electron-rebuild.cmd
\ Building module: winax, Completed: 0gyp info find Python using Python version 3.7.2 found at "C:\Users\xxx\.pyenv\pyenv-win\versions\3.7.2\python3.exe"
| Building module: winax, Completed: 0gyp info find VS using VS2019 (16.9.31205.134) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Users\xxx\.pyenv\pyenv-win\versions\3.7.2\python3.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\xxx\\Desktop\\fuzhu\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\xxx\\Desktop\\fuzhu\\node_modules\\winax\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\xxx\\Desktop\\fuzhu\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\xxx\\.electron-gyp\\12.0.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\xxx\\.electron-gyp\\12.0.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\xxx\\Desktop\\fuzhu\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\xxx\\\\.electron-gyp\\\\12.0.1\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\xxx\\Desktop\\fuzhu\\node_modules\\winax',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\xxx\\Desktop\\fuzhu\\node_modules\\winax\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
/ Building module: winax, Completed: 0gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args   'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=Win32',
gyp info spawn args   map: [Function]
gyp info spawn args ]
Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
/ Building module: winax, Completed: 0  main.cpp
/ Building module: winax, Completed: 0C:\Users\xxx\.electron-gyp\12.0.1\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
/ Building module: winax, Completed: 0  utils.cpp
/ Building module: winax, Completed: 0C:\Users\xxx\.electron-gyp\12.0.1\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
| Building module: winax, Completed: 0  disp.cpp
\ Building module: winax, Completed: 0C:\Users\xxx\.electron-gyp\12.0.1\include\node\v8.h(1650,55): warning C4996: 'v8::Module::ResolveCallback': Use ResolveModuleCallback [C:\Users\xxx\Desktop\fuzhu\node_modules\winax\build\node_activex.vcxproj]
\ Building module: winax, Completed: 0  win_delay_load_hook.cc
/ Building module: winax, Completed: 0    ????? 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
- Building module: winax, Completed: 0disp.obj : error LNK2001: ????????? "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __thiscall v8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QAE?AV?$shared_ptr@VBackingStore@v8@@@std@@XZ) [C:\Users\yangyoucu
n\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.vcxproj]
× Rebuild Failed

An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\Users\xxx\Desktop\fuzhu\node_modules\winax'.
Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1

Error: node-gyp failed to rebuild 'C:\Users\xxx\Desktop\fuzhu\node_modules\winax'.
Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1

    at ModuleRebuilder.rebuildNodeGypModule (C:\Users\xxx\Desktop
···
Gavin-YYC commented 3 years ago

It's worked for me:

Update:

node(32): 12.18.3
electron: 11.4.7
wianx: 3.1.4
durs commented 3 years ago

also try new fix winax@3.1.4

Gavin-YYC commented 3 years ago

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.

durs commented 3 years ago

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 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

@.*** 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: 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! @.*** 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 .

Gavin-YYC commented 3 years ago

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?