我无法使用织物构建电子应用程序,出现以下错误
LINK : fatal error LNK1104: cannot open file 'C:\libjpeg-turbo64\lib\jpeg.lib' [<path>\node_modules\canvas\build\canvas.vcxproj]
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\<user>\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=<path>\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=<path>\node_modules\canvas\build\Release --napi_version=4 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=electron-v5.0' (1)
errorOut=node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.0/canvas-v2.6.0-electron-v5.0-win32-unknown-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.0 and electron@5.0.2 (electron-v5.0 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
答案 0 :(得分:0)
Electron没有可用的预构建版本。
来源:https://github.com/Automattic/node-canvas/issues/1511
解决方案是通过“ npm install canvas@2.6.0 --verbose ”自己构建它。