Closed niaocaixiao closed 1 month ago
同问
应该是node版本问题,在14版本下node编译出现这个问题,换到10.16.0版本,就没有出现了。
This issue has not been updated for over 1 year and will be marked as stale. If the issue still exists, please comment or update the issue, otherwise it will be closed after 7 days.
This issue has been automatically closed due to inactivity. If the issue still exists, please reopen it.
OKAY take it away
electron-builder`• electron-builder version=22.10.5 os=10.0.18363 • loaded configuration file=package.json ("build" field) • writing effective config file=build\builder-effective-config.yaml • rebuilding native dependencies dependencies=nodejieba@2.5.1 platform=win32 arch=x64 ⨯ cannot execute cause=exit status 1 out=
s not a member of 'Napi' (compiling source file ..\lib\nodejieba.cpp) [D:\Git_workspace\code-generate \node_modules\nodejieba\build\nodejieba.vcxproj] d:\git_workspace\code-generate\node_modules\node-addon-api\napi-inl.h(17): note: see declaratio n of 'Napi' (compiling source file ..\lib\nodejieba.cpp) d:\git_workspace\code-generate\node_modules\nodejieba\lib\nodejieba.h(8): error C2504: 'Addon': b ase class undefined (compiling source file ..\lib\nodejieba.cpp) [D:\Git_workspace\code-generate\node _modules\nodejieba\build\nodejieba.vcxproj] d:\git_workspace\code-generate\node_modules\nodejieba\lib\nodejieba.h(8): error C2143: syntax err or: missing ',' before '<' (compiling source file ..\lib\nodejieba.cpp) [D:\Git_workspace\code-genera te\node_modules\nodejieba\build\nodejieba.vcxproj] d:\git_workspace\code-generate\node_modules\nodejieba\lib\nodejieba.h(8): error C2039: 'Addon': i s not a member of 'Napi' (compiling source file ..\lib\index.cpp) [D:\Git_workspace\code-generate\nod e_modules\nodejieba\build\nodejieba.vcxproj] d:\git_workspace\code-generate\node_modules\node-addon-api\napi-inl.h(17): note: see declaratio n of 'Napi' (compiling source file ..\lib\index.cpp) d:\git_workspace\code-generate\node_modules\nodejieba\lib\nodejieba.h(8): error C2504: 'Addon': b ase class undefined (compiling source file ..\lib\index.cpp) [D:\Git_workspace\code-generate\node_mod ules\nodejieba\build\nodejieba.vcxproj] d:\git_workspace\code-generate\node_modules\nodejieba\lib\nodejieba.h(8): error C2143: syntax err or: missing ',' before '<' (compiling source file ..\lib\index.cpp) [D:\Git_workspace\code-generate\n ode_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\index.cpp(3): error C2039: 'Init': is not a member of 'NodeJieba' [D:\Git_workspace\code-g enerate\node_modules\nodejieba\build\nodejieba.vcxproj] d:\git_workspace\code-generate\node_modules\nodejieba\lib\nodejieba.h(8): note: see declaration of 'NodeJieba' ..\lib\index.cpp(3): error C2065: 'Init': undeclared identifier [D:\Git_workspace\code-generate\n ode_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(10): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(11): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(12): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(13): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(14): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(15): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(16): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(17): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(18): error C3861: 'InstanceMethod': identifier not found [D:\Git_workspace\c ode-generate\node_modules\nodejieba\build\nodejieba.vcxproj] ..\lib\nodejieba.cpp(9): error C3861: 'DefineAddon': identifier not found [D:\Git_workspace\code- generate\node_modules\nodejieba\build\nodejieba.vcxproj] Failed to execute 'D:\Program Files\nodejs\node.exe C:\Users\wal\AppData\Roaming\nvm\v 14.16.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=D:\ Git_workspace\code-generate\node_modules\nodejieba\build\Release\nodejieba.node --module_name=nodejie ba --module_path=D:\Git_workspace\code-generate\node_modules\nodejieba\build\Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v8.5' (1)
v2.5.1/nodejieba-v2.5.1-electron-v8.5-win32-x64.tar.gz node-pre-gyp WARN Pre-built binaries not found for nodejieba@2.5.1 and electron@8.5.5 (electron-v 8.5 ABI, unknown) (falling back to source compile with node-gyp) gyp ERR! build error gyp ERR! stack Error: (D:\Git_workspace\code-generate\node_modu
les\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288
:5)
node-pre-gyp ERR! System Windows_NT 10.0.18363
node-pre-gyp ERR! command "D:\Program Files\nodejs\node.exe" "D:\Git_workspace\code-generate
\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\Git_workspace\code-generate\node_modules\nodejieba
node-pre-gyp ERR! node -v v14.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodejieba@2.5.1 install:
C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe
failed with exit code : 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\wal\AppData\Roaming\nvm\v14.16.1\n ode_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:277:12) gyp ERR! System Windows_NT 10.0.18363 gyp ERR! command "D:\Program Files\nodejs\node.exe" "C:\Users\wal\AppData\Roami ng\nvm\v14.16.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" "--fallback-t o-build" "--module=D:\Git_workspace\code-generate\node_modules\nodejieba\build\Release\nodejie ba.node" "--module_name=nodejieba" "--module_path=D:\Git_workspace\code-generate\node_modules\nod ejieba\build\Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_na pi_label=electron-v8.5" gyp ERR! cwd D:\Git_workspace\code-generate\node_modules\nodejieba gyp ERR! node -v v14.16.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute 'D:\Program Files\nodejs\node.exe C:\Users\zhang weigang01\AppData\Roaming\nvm\v14.16.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build - -fallback-to-build --module=D:\Git_workspace\code-generate\node_modules\nodejieba\build\Release\nodej ieba.node --module_name=nodejieba --module_path=D:\Git_workspace\code-generate\node_modules\nodejieba \build\Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electro n-v8.5' (1) node-pre-gyp ERR! stack at ChildProcess.node-pre-gyp install --fallback-to-build
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the nodejieba@2.5.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above .ng\nvm\v14.16.1\node_modules\npm\bin\npm-cli.js' rebuild nodejieba@2.5.1 workingDir= npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! code-generate@0.0.1 build:
node .electron-vue/build.js && electron-builder
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the code-generate@0.0.1 build 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! D:\Program Files\nodejs\node_cache_logs\2021-04-12T10_07_01_493Z-debug.log` node版本v14.16.1,npm run dev可以正常运行,但是用electron-builder打包就会失败