MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    cannot install pm2

    Scheduled Pinned Locked Moved Troubleshooting
    46 Posts 2 Posters 14.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      mrlowndes
      last edited by

      Hello. I’m getting this error when I try to install pm2:

      • do I install in /MagicMirror directory?
      pi@raspberrypi:~/MagicMirror $ sudo npm install -g pm2
      npm ERR! Unexpected end of JSON input while parsing near '...s":{"moment-timezone"'
      
      npm ERR! A complete log of this run can be found in:
      npm ERR!     /root/.npm/_logs/2020-04-29T18_34_01_247Z-debug.log
      
      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @mrlowndes
        last edited by

        @mrlowndes not in MagicMirror…

        did u try to install MagicMirror manually ?

        do node -v and npm -v

        what OS is this

        show results of lsb_release -a

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • M Offline
          mrlowndes
          last edited by

          @sdetweil yes, manual install of MM

          pi@raspberrypi:~ $ node -v
          v10.20.1
          pi@raspberrypi:~ $ npm -v
          6.14.4
          

          how do I show results of lsb_release -a?

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @mrlowndes
            last edited by sdetweil

            @mrlowndes lsb_release -a

            same way you did results of npm -v

            on my desktop i see

            (base) sam@sams:~/MagicMirror$ lsb_release -a
            No LSB modules are available.
            Distributor ID:	Ubuntu
            Description:	Ubuntu 18.04.4 LTS
            Release:	18.04
            Codename:	bionic
            

            do this

            sudo apt-get purge -y npm 
            

            then

            rm -rf ~/MagicMirror
            

            and then run my installer script from here
            https://github.com/sdetweil/MagicMirror_scripts
            read the readme for the command to issue

            it will ask to install pm2 and disable screen saver

            if you don’t, then I have extra scripts to do those

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 1
            • M Offline
              mrlowndes
              last edited by

              @sdetweil ok I’ll give that a go. In the meantime:

              pi@raspberrypi:~ $ sudo npm install -g pm2
              npm ERR! Unexpected end of JSON input while parsing near '...s":{"moment-timezone"'
              
              npm ERR! A complete log of this run can be found in:
              npm ERR!     /root/.npm/_logs/2020-04-29T18_49_06_787Z-debug.log
              

              and

              pi@raspberrypi:~/MagicMirror $ lsb_release -a
              No LSB modules are available.
              Distributor ID:	Raspbian
              Description:	Raspbian GNU/Linux 10 (buster)
              Release:	10
              Codename:	buster
              
              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @mrlowndes
                last edited by

                @mrlowndes so, I asked you to uninstall npm

                sudo apt-get purge -y npm 
                

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 1
                • M Offline
                  mrlowndes
                  last edited by

                  @sdetweil yes, stand by…

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    mrlowndes
                    last edited by

                    @sdetweil purged npm, now running your installer script…updating packages…I’m on a 2Mb/s internet connection…

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      mrlowndes
                      last edited by

                      @sdetweil

                      We're ready! Run pm2 start MagicMirror from the ~/MagicMirror directory to start your MagicMirror.
                       
                       
                      pi@raspberrypi:~ $ cd MagicMirror
                      pi@raspberrypi:~/MagicMirror $ pm2 start MagicMirror
                      bash: pm2: command not found
                      pi@raspberrypi:~/MagicMirror $ 
                      
                      S 1 Reply Last reply Reply Quote 0
                      • M Offline
                        mrlowndes
                        last edited by

                        @sdetweil looks like pm2 was not installed:

                        Splashscreen: Changed theme to MagicMirror successfully.
                        Do you want use pm2 for auto starting of your MagicMirror (y/N)?y
                        install and setup pm2
                        bash: line 442: pm2: command not found
                        bash: line 518: pm2: command not found
                        bash: line 521: pm2: command not found
                        Do you want to disable the screen saver? (y/N)?y
                        
                        1 Reply Last reply Reply Quote 0
                        • S Offline
                          sdetweil @mrlowndes
                          last edited by

                          @mrlowndes did u reply yes or no?

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          S 1 Reply Last reply Reply Quote 0
                          • S Offline
                            sdetweil @sdetweil
                            last edited by

                            @sdetweil run the fixuppm2 script from my site

                            Sam

                            How to add modules

                            learning how to use browser developers window for css changes

                            1 Reply Last reply Reply Quote 1
                            • M Offline
                              mrlowndes
                              last edited by

                              @sdetweil

                              pi@raspberrypi:~ $ bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)"
                              the log will be saved in /home/pi/MagicMirror/installers/pm2_setup.log
                              npm ERR! Unexpected end of JSON input while parsing near '...s":{"moment-timezone"'
                              
                              npm ERR! A complete log of this run can be found in:
                              npm ERR!     /root/.npm/_logs/2020-04-29T20_09_52_853Z-debug.log
                              bash: line 103: pm2: command not found
                              bash: line 180: pm2: command not found
                              bash: line 183: pm2: command not found
                              
                              S 1 Reply Last reply Reply Quote 0
                              • S Offline
                                sdetweil @mrlowndes
                                last edited by

                                @mrlowndes ok, lets do

                                sudo npm purge -g pm2 
                                

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                1 Reply Last reply Reply Quote 1
                                • M Offline
                                  mrlowndes
                                  last edited by

                                  I don’t think that worked. Tried to paste code but got flagged as spam

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Offline
                                    sdetweil @mrlowndes
                                    last edited by

                                    @mrlowndes
                                    try

                                    sudo npm uninstall -g pm2 
                                    

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    1 Reply Last reply Reply Quote 1
                                    • M Offline
                                      mrlowndes
                                      last edited by

                                      @sdetweil ok done. Now should I try bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)" again?

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Offline
                                        sdetweil @mrlowndes
                                        last edited by

                                        @mrlowndes yes

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

                                        1 Reply Last reply Reply Quote 1
                                        • M Offline
                                          mrlowndes
                                          last edited by

                                          @sdetweil same result:

                                          pi@raspberrypi:~ $ bash -c "$(curl -sL https://raw.githubusercontent.com/sdetweil/MagicMirror_scripts/master/fixuppm2.sh)"
                                          
                                          the log will be saved in /home/pi/MagicMirror/installers/pm2_setup.log
                                          npm ERR! Unexpected end of JSON input while parsing near '...s":{"moment-timezone"'
                                          
                                          npm ERR! A complete log of this run can be found in:
                                          npm ERR!     /root/.npm/_logs/2020-04-29T20_19_40_905Z-debug.log
                                          bash: line 103: pm2: command not found
                                          bash: line 180: pm2: command not found
                                          bash: line 183: pm2: command not found
                                          
                                          S 1 Reply Last reply Reply Quote 0
                                          • S Offline
                                            sdetweil @mrlowndes
                                            last edited by

                                            @mrlowndes ok, time to get crazy , kill all npm stuff

                                            /cd ~
                                            sudo apt-get purge -y npm 
                                            sudo rm -rf .npm
                                            sudo apt-get install -y npm 
                                            cd MagicMirror
                                            rm -rf node_modules
                                            npm install
                                            

                                            then do the fixuppm2 script again

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            1 Reply Last reply Reply Quote 1

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 3
                                            • 1 / 3
                                            • First post
                                              Last post
                                            Enjoying MagicMirror? Please consider a donation!
                                            MagicMirror created by Michael Teeuw.
                                            Forum managed by Sam, technical setup by Karsten.
                                            This forum is using NodeBB as its core | Contributors
                                            Contact | Privacy Policy