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 18.3k 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
      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
        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
          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
            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
              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
                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
                  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
                    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
                    • M
                      mrlowndes
                      last edited by

                      @sdetweil still nothing:

                      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 '...pes/node":"^12.7.5","'
                      
                      npm ERR! A complete log of this run can be found in:
                      npm ERR!     /root/.npm/_logs/2020-04-29T21_00_10_606Z-debug.log
                      bash: line 103: pm2: command not found
                      bash: line 180: pm2: command not found
                      bash: line 183: pm2: command not found
                      
                      1 Reply Last reply
                      Reply Quote 0
                      • S
                        sdetweil
                        last edited by

                        @mrlowndes said in cannot install pm2:

                        npm ERR! Unexpected end of JSON input while parsing near '…pes/node":"^12.7.

                        u are getting weird failures…

                        every time we have seen this, it is the SD card failing.

                        Sam

                        How to add modules

                        learning how to use browser developers window for css changes

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

                          hmm good question.

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

                            @sdetweil should be fine its a SanDisk Ultra Plus 64GB U1 SDXC

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

                              @sdetweil if it is the SD card, is it the kind of thing a deep format and reinstall of Raspbian will fix, or is the SD just terminally bad? Wen I reinstalled Raspbian the last time, I did just do a quick format on this card before flashing the image.

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

                                @mrlowndes when the sd card starts to fail, it is toast

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

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

                                  @sdetweil bummer - it’s brand new out of the box. Just managed to scrounge another from my GoPro. Ill format that, reflash Raspbian and see how I go. I’ll just use your script first off, rather than doing a manual install. I’ll let you know how I get on, on here but it will take me a long time with all the updates that Raspbian does. Thanks so much for your help.

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

                                    @mrlowndes ok, will be around…

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    1 Reply Last reply
                                    Reply Quote 1
                                    • S
                                      sdetweil
                                      last edited by

                                      someone else just reported a similar failure on a pi 0.

                                      so, I reflashed my sd card with buster and ran the installer without any issues on a pi 0w

                                      Sam

                                      How to add modules

                                      learning how to use browser developers window for css changes

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

                                        I ran your script and it didn’t finish - Unable to install dependencies! Also, this website has locked me out of singing into my account from my pi…

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

                                          @sdetweil could it not be working because npm WARN npm npm does not support Node.js v10.15.2?

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

                                            @mrlowndes hm I don’t know anything about how this website works. Just another user.

                                            Can u show me the ~/install.log?

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            1 Reply Last reply
                                            Reply Quote 0

                                            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
                                            • 2 / 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