运行 Electron CLI 在 Ubuntu-18.04 中出错

Error in running Electron CLI in Ubuntu-18.04

当我在 linux 上成功安装 electron 8.2 时,我在 运行 cli 命令时遇到了这个错误:

electron .

/usr/local/lib/node_modules/electron/index.js:14 throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again') ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again at getElectronPath (/usr/local/lib/node_modules/electron/index.js:14:11) at Object. (/usr/local/lib/node_modules/electron/index.js:18:18) at Module._compile (internal/modules/cjs/loader.js:1158:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10) at Module.load (internal/modules/cjs/loader.js:1002:32) at Function.Module._load (internal/modules/cjs/loader.js:901:14) at Module.require (internal/modules/cjs/loader.js:1044:19) at require (internal/modules/cjs/helpers.js:77:18) at Object. (/usr/local/lib/node_modules/electron/cli.js:3:16) at Module._compile (internal/modules/cjs/loader.js:1158:30)

好吧,问题似乎出在 usr/local/lib/node_modules/electron 文件夹上。 它似乎安装不正确。 所以,我复制了本地项目中的 node_modules/electron/dist 文件夹并粘贴到上面提到的全局文件夹中: 呜呜呜呜呜呜呜呜!!!!!!已解决