MagicMirror² v2.4.1 is available! For more information about this release, check out this topic.
Please read the release notes carefully since this update requires adjustments to your Raspberry Pi configuration!

npm ERR! cb() never called! _ when trying to install MMM-RTSPStream

  • Hey guys,

    i actually downgraded my MM to 2.1.0 and electron 1.4.15 cause of the “CPU Usage Problem”…
    However the MM runs very well and all Modules are fluety.

    Now i was trying to install the MMM-RTSPStream Module but get an error message. All other modules, where i needed to use npm install were good.

    i just clone the module into my MagicMirror/modules folder and cd in the new folder. when i type in “nom install” i get the message below:

    pi@MagicMirror:~ $ cd ~/MagicMirror/modules
    pi@MagicMirror:~/MagicMirror/modules $ git clone
    Klone nach 'MMM-RTSPStream' ...
    remote: Counting objects: 162, done.
    remote: Total 162 (delta 0), reused 0 (delta 0), pack-reused 162
    Empfange Objekte: 100% (162/162), 1.02 MiB | 804.00 KiB/s, Fertig.
    Löse Unterschiede auf: 100% (102/102), Fertig.
    pi@MagicMirror:~/MagicMirror/modules $ cd MMM-RTSPStream
    pi@MagicMirror:~/MagicMirror/modules/MMM-RTSPStream $ npm install
    npm ERR! cb() never called!
    pi@MagicMirror:~/MagicMirror/modules/MMM-RTSPStream $

    Well, i am not a brilliant programmer, so i hope to get some help of you guys.

    Thank you very much 🙂

  • Module Developer

    What version of node/npm are you using? And is this on a Raspberry Pi? The commands below will tell you the versions.

    node -v
    npm -v

  • hi,

    yes, its on a raspberry pi 3.

    pi@MagicMirror:~ $ node -v
    pi@MagicMirror:~ $ npm -v


    well, first it started to install something. i did it via ssh, so i changed to my browser to surf in the web while the raspberry is installing. When i looked back i just saw this message shown above.

  • Module Developer

    You may try and update node and npm then retry:

    Update npm:

    npm install -g npm

    Update node (should update npm too):

    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable

  • @shbatm said in npm ERR! cb() never called! _ when trying to install MMM-RTSPStream:

    npm install -g npm

    as i typed in this, it started to install and shows this:

    npm ERR! Linux 4.9.59-v7+
    npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "npm"
    npm ERR! node v6.12.2
    npm ERR! npm  v3.10.10
    npm ERR! path /usr/lib/node_modules/npm/node_modules/abbrev
    npm ERR! code EACCES
    npm ERR! errno -13
    npm ERR! syscall access
    npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules/npm/node_modules/abbrev'
    npm ERR!     at Error (native)
    npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules/npm/node_modules/abbrev'
    npm ERR!     at Error (native)
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'access',
    npm ERR!   path: '/usr/lib/node_modules/npm/node_modules/abbrev' }
    npm ERR! 
    npm ERR! Please try running this command again as root/Administrator.
    npm ERR! Please include the following file with any support request:
    npm ERR!     /home/pi/npm-debug.log

    so i did it as root and rebooted my pi.

    now i installed your module and got some warnings AND some errors:

    pi@MagicMirror:~/MagicMirror/modules/MMM-RTSPStream $ npm install
    npm WARN registry Unexpected warning for Miscellaneous Warning EINTEGRITY: sha1-QFUCsAfzGcP0cXXER0UnMA8qta0= integrity checksum failed when using sha1: wanted sha1-QFUCsAfzGcP0cXXER0UnMA8qta0= but got sha512-zr6QQnzLt3Ja0t0XI8gws2kn7zV2p0l/D3kreNvS6hFZhVU5g+uY/30l42jbgt0XGcNBEmBDGJR71J692V92tA==. (260 bytes)
    npm WARN registry Using stale package data from due to a request error during revalidation.
    > MMM-RTSPStream@1.2.1 postinstall /home/pi/MagicMirror/modules/MMM-RTSPStream
    > ./ && sudo npm i -g http-server
    Applying Graceful Shutdown patch to MagicMirror.
    error: Anwendung des Patches fehlgeschlagen: js/electron.js:96
    error: js/electron.js: Patch konnte nicht angewendet werden
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! MMM-RTSPStream@1.2.1 postinstall: `./ && sudo npm i -g http-server`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the MMM-RTSPStream@1.2.1 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!     /home/pi/.npm/_logs/2017-12-22T17_39_55_666Z-debug.log
    pi@MagicMirror:~/MagicMirror/modules/MMM-RTSPStream $ 


    i took a look in the debug_log file after the reboot of the pi (2017-12-22T17_36_34_105Z-debug.log) :

    0 info it worked if it ends with ok
    1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
    2 info using npm@5.6.0
    3 info using node@v9.2.1
    4 verbose run-script [ 'prestart', 'start', 'poststart' ]
    5 info lifecycle magicmirror@2.1.0~prestart: magicmirror@2.1.0
    6 info lifecycle magicmirror@2.1.0~start: magicmirror@2.1.0
    7 verbose lifecycle magicmirror@2.1.0~start: unsafe-perm in lifecycle true
    8 verbose lifecycle magicmirror@2.1.0~start: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/MagicMirro$
    9 verbose lifecycle magicmirror@2.1.0~start: CWD: /home/pi/MagicMirror
    10 silly lifecycle magicmirror@2.1.0~start: Args: [ '-c', 'electron js/electron.js' ]
    11 silly lifecycle magicmirror@2.1.0~start: Returned: code: 1  signal: null
    12 info lifecycle magicmirror@2.1.0~start: Failed to exec start script
    13 verbose stack Error: magicmirror@2.1.0 start: `electron js/electron.js`
    13 verbose stack Exit status 1
    13 verbose stack     at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
    13 verbose stack     at EventEmitter.emit (events.js:159:13)
    13 verbose stack     at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    13 verbose stack     at ChildProcess.emit (events.js:159:13)
    13 verbose stack     at maybeClose (internal/child_process.js:943:16)
    13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
    14 verbose pkgid magicmirror@2.1.0
    15 verbose cwd /home/pi/MagicMirror
    16 verbose Linux 4.9.59-v7+
    17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
    18 verbose node v9.2.1
    19 verbose npm  v5.6.0
    20 error code ELIFECYCLE
    21 error errno 1
    22 error magicmirror@2.1.0 start: `electron js/electron.js`
    22 error Exit status 1
    23 error Failed at the magicmirror@2.1.0 start script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 1, true ]

    could it be, that my downgrade to 2.1.0 is to blame?

  • Module Developer

    It may be the downgrade or a bug in the post install script for my module. Backstory: My module tries to install a patch to the main electron.js file on older MM versions so it can safely close the streams when you shut down the mirror - this is now included in the core MM code and is not installed if the code already exists.

    The errors with npm upgrade: it should be sudo before that line, that’s why you have a bunch of permission errore, but the node update took care of the npm update too.

    To fix the mirror install, replace MagicMirror/js/electron.js with a fresh copy from github for your version of MM to undo whatever the patch broke when it failed.