"Error: Electron failed to install correctly" when using CLI
See original GitHub issueI used this package about six months ago without issue, but later versions (will report back with a since) seem to have the following error:
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
Quick test case:
docker run --rm -it --name test kipparker/docker-tape-run sleep 1000000
(just to get a quick test container up that has all the deps)
Connect into the container and npm install -g electron-pdf
. Run an electron-pdf
command, such as electron-pdf http://example.com ~/test.pdf
Results in something like:
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at Object.<anonymous> (/usr/local/lib/node_modules/electron-pdf/node_modules/electron/index.js:9:9)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/electron-pdf/cli.js:4:20)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
Issue Analytics
- State:
- Created 7 years ago
- Comments:8
Top Results From Across the Web
Error: Electron failed to install correctly, please delete ... - GitHub
I can not use Electron because it is not installed correctly, ... }\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "start"
Read more >Electron failed to install correctly, please delete node_modules
Make sure to delete node_modules folder and run yarn cache clean or npm cache verify to make sure the cache is healed from...
Read more >Error: Electron failed to install correctly, please delete ...
Are you stumbling in that error message: Electron failed to install correctly, please delete node_modules/electron and try installing again ...
Read more >MM Ver.2.21 Electron failed to install error - MagicMirror Forum
I just updated to ver 2.21. MM crashed and no longer working. npm start shows error magicmirror@2.21.0 start DISPLAY=“${DISPLAY:=:0}” .
Read more >Advanced Installation Instructions | Electron
In almost all cases, these errors are the result of network problems and not actual issues with the electron npm package. Errors like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had this problem as well on a fresh install on Ubuntu 18.04 with Node v8.10.0 and NPM 3.5.2.
I got it working by installing some additional packages and running electron/install.js after installing electron-pdf, see below:
Then you it works on command line e.g.
Thanks @colinwoods, I don’t know why I didn’t share this earlier, but this is how I have my image configured.
And while not required if only using electron-pdf I also use these packages (which may pull in other dependencies)