2016-09-27 40 views
1

Windows 10,Electron應用程序用於很好地工作,使用node-canvas lib。今天,終於更新:更新node.js和Electron後node-canvas失敗

NPM - > 2.15.9

節點 - > 4.5.0

電子預建 - > 1.4.1

再接着instructions更新和重建畫布庫。所有相關性更新,安裝[email protected]node-gyp rebuild得很順利,成功

但是 - 運行NPM開始運行應用程序失敗,出現以下跡:

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)

來回去年幾個小時,我總是以同樣的錯誤結束。我在做一些愚蠢的事情嗎?

感謝

+1

你重建使用的http://electron.atom.io/docs/tutorial/using記載的方法之一-native-node-modules /? –

+0

omg!我知道我在做一些愚蠢的事情。我建立反對節點,而不是電子....使用'電子重建'我得到了這個解決,但遇到https://github.com/electron/electron-rebuild/issues/15所以只是卸載nslog ...希望它不會回來咬我。感謝Vadim Macagon –

回答

0

安裝模塊之後,你需要運行electron-rebuild

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