MagicMirror icon indicating copy to clipboard operation
MagicMirror copied to clipboard

problmem when i run npm start

Open Hamzacos opened this issue 3 years ago • 3 comments

[email protected] start /home/pi/MagicMirror DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js

/home/pi/MagicMirror/node_modules/electron/index.js:17 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 (/home/pi/MagicMirror/node_modules/electron/index.js:17:11) at Object. (/home/pi/MagicMirror/node_modules/electron/index.js:21:18) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/pi/MagicMirror/node_modules/electron/cli.js:3:18) at Module._compile (internal/modules/cjs/loader.js:999:30) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] start: DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2022-01-28T20_09_06_161Z-debug.log

Hamzacos avatar Jan 28 '22 20:01 Hamzacos

what pi? uname - a will help

what pi os? lsb_release -a will help

if you used my scripted install it probably would have fixed the problem see https://github.com/sdetweil/MagicMirror_scripts

sdetweil avatar Jan 28 '22 20:01 sdetweil

This problem is due to improper installation of electron.

Try to remove node_modules and npm cache clean --force

After doing this, run npm i

A piece of advice have a good internet connection to avoid having a corrupt installation of electron !

jboucly avatar Feb 16 '22 12:02 jboucly

@Hamzacos did you resolve this?

sdetweil avatar Mar 27 '22 18:03 sdetweil

Maybe we shoudl close this @MichMich since @Hamzacos hasnt responded in quite a few months...

rejas avatar Oct 02 '22 19:10 rejas