npm errors when trying to load magic mirror

Replies
2
Voices
1
Thomas Wilkerson

Any advice on what to do with this error? I installed magic mirror by copying the code in the Complete Tutorial (Newbie Friendly). During that install, I saw an error on most of the lines that told me to run npm XXXX @npmlatest -g (I don’t remember what was in place of the XXXX) I ran that and rebooted. When I tried to run: DISPLAY=:0 npm start, I got another error which mentioned Electron. As such, I tried to run the code to download 1.7.6 as you can see below. Please advise.

pi@magicpi:~ $ sudo npm install -g electron@1.7.6
/usr/bin/electron -> /usr/lib/node_modules/electron/cli.js

> electron@1.7.6 postinstall /usr/lib/node_modules/electron
> node install.js

/usr/lib/node_modules/electron/install.js:48
throw err
^

Error: EACCES: permission denied, mkdir ‘/usr/lib/node_modules/electron/.electron’
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@1.7.6 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.7.6 postinstall 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! /root/.npm/_logs/2018-08-14T20_36_21_955Z-debug.log
pi@magicpi:~ $ cd ~/MagicMirror

Facebook Comments

You may also like...

  • Edit
    Thomas Wilkerson

    Here is the other error:

    pi@magicpi:~/MagicMirror $ DISLAY=:0 npm start

    > magicmirror@2.4.1 start /home/pi/MagicMirror
    > sh run-start.sh

    /home/pi/MagicMirror/node_modules/electron/index.js:9
    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 Object. (/home/pi/MagicMirror/node_modules/electron/index.js:9:9)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Module.require (internal/modules/cjs/loader.js:598:17)
    at require (internal/modules/cjs/helpers.js:11:18)
    at Object. (/home/pi/MagicMirror/node_modules/electron/cli.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! magicmirror@2.4.1 start: `sh run-start.sh`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the magicmirror@2.4.1 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/2018-08-14T20_52_29_237Z-debug.log

  • Edit
    Thomas Wilkerson

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
    2 info using npm@6.3.0
    3 info using node@v9.11.2
    4 verbose run-script [ 'prestart', 'start', 'poststart' ]
    5 info lifecycle magicmirror@2.4.1~prestart: magicmirror@2.4.1
    6 info lifecycle magicmirror@2.4.1~start: magicmirror@2.4.1
    7 verbose lifecycle magicmirror@2.4.1~start: unsafe-perm in lifecycle true
    8 verbose lifecycle magicmirror@2.4.1~start: PATH: /usr/lib/node_modules/npm/node_mod$
    9 verbose lifecycle magicmirror@2.4.1~start: CWD: /home/pi/MagicMirror
    10 silly lifecycle magicmirror@2.4.1~start: Args: [ '-c', 'sh run-start.sh' ]
    11 silly lifecycle magicmirror@2.4.1~start: Returned: code: 1 signal: null
    12 info lifecycle magicmirror@2.4.1~start: Failed to exec start script
    13 verbose stack Error: magicmirror@2.4.1 start: `sh run-start.sh`
    13 verbose stack Exit status 1
    13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modu$
    13 verbose stack at EventEmitter.emit (events.js:180:13)
    13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modu$
    13 verbose stack at ChildProcess.emit (events.js:180:13)
    13 verbose stack at maybeClose (internal/child_process.js:936:16)
    13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.j$
    14 verbose pkgid magicmirror@2.4.1
    15 verbose cwd /home/pi/MagicMirror
    16 verbose Linux 4.14.61-v7+
    17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
    18 verbose node v9.11.2
    19 verbose npm v6.3.0
    20 error code ELIFECYCLE
    21 error errno 1
    22 error magicmirror@2.4.1 start: `sh run-start.sh`
    22 error Exit status 1
    23 error Failed at the magicmirror@2.4.1 start script.
    23 error This is probably not a problem with npm. There is likely additional logging $
    24 verbose exit [ 1, true ]