MagicMirror² v2.7.0 is available! For more information about this release, check out this topic.

npm install error



  • I am working with my friend on a project. When I downloaded what my friend had been working on with my raspberry pie and installed npm start, I got the error:
    0_1555310776532_d9fb8868-2613-4b33-a10d-a0d7000d7d14-image.png 0_1555304255464_b4b7f1e4-c8e5-459d-88d5-7c58c63552d1-image.png
    Friend’s environment is Mac, and I downloaded it to the raspberry pie.

    My freiend’s repository is https://github.com/ENTITYSmartMirror/BeautyMirrorTEST

    Friend installed and used python-shell module on April 15.

    /home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: 1: /home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: ���� � 0: not found
    /home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: 4: /home/pi/Desktop/BeautyMirrorTEST/node_modules/electron/dist/Electron.app/Contents/MacOS/Electron: Syntax error: word unexpected (expecting “)”)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! magicmirror@2.6.0 start: sh run-start.sh
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the magicmirror@2.6.0 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/2019-04-15T06_36_00_871Z-debug.log



  • I’m not really sure what your question is, or if you even have a question?
    I’m making the assumption that your question is: why do you get the errors? That is probably because mac and RPI have 2 totally diferrent operatings systems.
    The errors are a result of that, This bold part of the error is telling that the ellection.app is installed on MacOS: "Electron.app/Contents/MacOS/Electron: 1: " But you are running it on a RPI.

    To solve this you can do a clean install of MagicMirror on the RPI and install the modules as well. Then copy the changed config files, probably being config.js and custom.css



  • @emrhssla ok, so you are installing a clone of MM… its ok, do that all the time.

    after the git clone, then u do npm install, right?

    he has copied the node_modules folder into his repo… u don’t want that…

    so, go to the folder

    /home/pi/Desktop/BeautyMirrorTEST
    

    and do

    rm -rf node_modules
    npm install
    

    then try the

    npm start dev &
    

    and have him remove the node_modules folder from his git repo
    and from all the modules which have a node_modules folder…
    and the vendor folder too

    the platforms are different, you cannot copy the binary runtimes



  • This post is deleted!


  • @sdetweil Same problem identification, way better solution!



  • @sdetweil

    pi@raspberrypi:~/Desktop/Chanyoung/BeautyMirrorTEST $ rm -rf node_modules
    pi@raspberrypi:~/Desktop/Chanyoung/BeautyMirrorTEST $ npm install
    npm WARN deprecated time-grunt@2.0.0: Deprecated because Grunt is practically unmaintained. Move on to something better. This package will continue to work with Grunt v1, but it will not receive any updates.
    npm ERR! code ENOLOCAL
    npm ERR! Could not install from "node_modules/danger/vm2@github:patriksimek/vm2#7e82f90ac705fc44fad044147cb0df09b4c79a57" as it does not contain a package.json file.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/pi/.npm/_logs/2019-04-15T12_43_25_301Z-debug.log
    
    

    …?



  • @emrhssla AND delete node_modules from all locations, right? vendor and all modules

    from the MM folder do

    WATCH OUT, THIS WILL ERASE ALL THE node_modules IN THE EMBEDED MagicMirror

    find . | grep node_modules$ | xargs rm -rf 
    

    and

    find . | grep package-lock.json | xargs rm 
    

    this erases all the mac based stuff that should not have been added to the repo
    then

    npm install
    


  • @emrhssla also delete the package-lock.json files in the few folders



  • @ganget

    I think cleaning is the answer too…



  • @sdetweil

    pi@pi:~/newTest $ npm start
    
    > magicmirror@2.6.0 start /home/pi/newTest
    > sh run-start.sh
    
    Starting MagicMirror: v2.6.0
    Loading config ...
    Loading module helpers ...
    No helper found for module: MMM-iFrame.
    No helper found for module: MMM-EmbedYoutube1.
    No helper found for module: MMM-Modulebar1.
    No helper found for module: MMM-Modulebar.
    No helper found for module: MMM-Dynamic-Modules.
    No helper found for module: alert.
    WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'node_helper'
    Loading module helpers ...
    No helper found for module: MMM-iFrame.
    No helper found for module: MMM-EmbedYoutube1.
    No helper found for module: MMM-Modulebar1.
    No helper found for module: MMM-Modulebar.
    No helper found for module: MMM-Dynamic-Modules.
    No helper found for module: alert.
    App threw an error during load
    Error: Cannot find module 'node_helper'
        at Module._resolveFilename (module.js:543:15)
        at Function.Module._resolveFilename (/home/pi/newTest/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
        at Function.Module._load (module.js:473:25)
        at Module.require (module.js:586:17)
        at require (internal/module.js:11:18)
        at Object. (/home/pi/newTest/modules/default/updatenotification/node_helper.js:6:18)
        at Object. (/home/pi/newTest/modules/default/updatenotification/node_helper.js:92:3)
        at Module._compile (module.js:642:30)
        at Object.Module._extensions..js (module.js:653:10)
        at Module.load (module.js:561:32)
    Whoops! There was an uncaught exception...
    { Error: Cannot find module 'node_helper'
        at Module._resolveFilename (module.js:543:15)
        at Function.Module._resolveFilename (/home/pi/newTest/node_modules/electron/dist/resources/electron.asar/common/reset-search-paths.js:35:12)
        at Function.Module._load (module.js:473:25)
        at Module.require (module.js:586:17)
        at require (internal/module.js:11:18)
        at Object. (/home/pi/newTest/modules/default/updatenotification/node_helper.js:6:18)
        at Object. (/home/pi/newTest/modules/default/updatenotification/node_helper.js:92:3)
        at Module._compile (module.js:642:30)
        at Object.Module._extensions..js (module.js:653:10)
        at Module.load (module.js:561:32) code: 'MODULE_NOT_FOUND' }
    MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    Launching application.
    

    0_1555407084699_6d9b5ec0-e929-486a-b30d-7e18f22c9f77-image.png

    0_1555407107394_a63b6673-fa2c-4635-8eb8-47ba20d25d8f-image.png