fail with electron

264 views
Skip to first unread message

朱餅乾

unread,
Mar 17, 2022, 5:26:08 AM3/17/22
to node-java
I want to use node-java with electron , but fail.
I don't know how to fix this. 

I install electron and java,then get node_module_error.

npm install --save-dev electron
npm install electron-windows-badge –save
npm install java
npm start

Get the following error.
-------------------------------------------------------------------------------------------------------------------
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 101. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1800)
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1199:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1800)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\ricky\Desktop\E2EE\PC\e2ee\node_modules\java\lib\nodeJavaBridge.js:21:16)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
-----------------------------------------------------------------------------------------------------------------------------
I follow the link(https://github.com/serialport/node-serialport/issues/1910), I remove java folder and packages-lock.json and rebuild electron. I get error again.
-----------------------------------------------------------------------------------------------------------------------------
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.11.32228.343) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2019 (16.11.32228.343) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS valid versions for msvs_version:
gyp ERR! find VS - "2019"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - "2019"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
× Rebuild Failed
-----------------------------------------------------------------------------------------------------------------------------------
I try to config the msvs_version to solve the problem, but still fail.
Could someone can give me advice, thanks.

node-gyp rebuild --runtime=electron --target=17.1.2 --arch=x64 --dist-url=https://www.electronjs.org/headers --build-from-source --verbose --msvs_version=2019

Get the following error.
It says unresolved external symbol.
It can't compiler ArrayBuffer.
-------------------------------------------------------------------------------------------------------------------

utils.obj : error LNK2019: 在函式 "__declspec(dllimport) public: class std::shared_ptr<class v8::BackingStore> __cdecl v

8::ArrayBuffer::GetBackingStore(void)" (__imp_?GetBackingStore@ArrayBuffer@v8@@QEAA?AV?$shared_ptr@VBackingStore@v8@@@s

td@@XZ)"class v8::Local<class v8::ArrayBuffer> __cdecl newArrayBuffer(void *,unsigned __int64)" (?newArrayBuffer@@YA?AV

?$Local@VArrayBuffer@v8@@@v8@@PEAX_K@Z) 中參考了無法解析的外部符號 [C:\Users\ricky\Desktop\E2EE\PC\e2ee\build\nodejavabridge_binding

s.vcxproj]

  C:\Users\ricky\Desktop\E2EE\PC\e2ee\build\Release\nodejavabridge_bindings.node : fatal error LNK1120: 1 個無法解析的外部符號 [C

:\Users\ricky\Desktop\E2EE\PC\e2ee\build\nodejavabridge_bindings.vcxproj]

 

    15 個警告

    2 個錯誤

 

經過時間 00:00:18.31

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 (C:\Users\ricky\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:194:23)gyp ERR! stack     at ChildProcess.emit (events.js:314:20)

gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)

gyp ERR! System Windows_NT 10.0.19044

gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ricky\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--runtime=electron" "--target=17.1.2" "--arch=x64" "--dist-url=https://www.electronjs.org/headers" "--build-from-source" "--verbose" "--msvs_version=2019"

gyp ERR! cwd C:\Users\ricky\Desktop\E2EE\PC\e2ee

gyp ERR! node -v v12.22.10

gyp ERR! node-gyp -v v9.0.0

gyp ERR! not ok



jim ho

unread,
Mar 17, 2022, 6:57:18 AM3/17/22
to node-java
I also meet this damage error for long time...
Is anyone teach us how to combine node-java with Electron ?

thank a lot...

cookie...@gmail.com 在 2022年3月17日 星期四下午5:26:08 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages