【问题标题】:node-canvas fail after updating node.js and Electron更新 node.js 和 Electron 后 node-canvas 失败
【发布时间】:2016-09-27 16:43:08
【问题描述】:

Windows 10,Electron 应用程序曾经运行良好,使用 node-canvas lib。今天终于更新了:

npm -> 2.15.9

节点 -> 4.5.0

电子预建 -> 1.4.1

然后跟随instructions 更新和重建画布库。更新所有依赖,安装canvas@1.5.0和node-gyp rebuild运行顺利,成功

但是 - 运行 npm start 来运行应用程序失败并出现以下跟踪:

App threw an error during load Error: A dynamic link library (DLL) initialization routine failed. \\?\D:\GoMixApp\web\electron\GoMixApp\node_modules\canvas\build\Release\canvas.node at Error (native) at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:168:20) at Object.Module._extensions..node (module.js:583:18) at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:168:20) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object.<anonymous> (D:\GoMixApp\web\electron\GoMixApp\node_modules\canvas\lib\bindings.js:3:18)

过去几个小时来回走动,我总是以同样的错误告终。我在做傻事吗?

谢谢

【问题讨论】:

标签: node.js canvas build electron


【解决方案1】:

安装模块后,需要运行electron-rebuild

npm install -g electron-rebuild
electron-rebuild -f -w canvas

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-10-05
    • 2020-01-27
    • 2021-04-24
    • 1970-01-01
    • 2017-03-29
    • 2019-12-23
    • 1970-01-01
    • 2011-08-16
    相关资源
    最近更新 更多