简体   繁体   中英

Error in running Electron CLI in Ubuntu-18.04

As I installed electron 8.2 successfully on my linux, I encountered this error while I ran the cli command:

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)

Well, it seems the problem is with the usr/local/lib/node_modules/electron folder. It seemed installed improperly. So, I copied the node_modules/electron/dist folder in local project and pasted in the global folder mentioned above and: wooooooooohoooooooooo!!!! solved

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM