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.

    Error on npm install

    Scheduled Pinned Locked Moved Solved Troubleshooting
    14 Posts 3 Posters 8.0k Views 3 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.
    • P Offline
      paddyhughes @rmeskill
      last edited by

      @rmeskill

      I just installed a module and it asked me to update NPM think i did it in the root directory not MagicMirror one can be sure.

      This is what worked for me
      sudo npm i -g npm

      1 Reply Last reply Reply Quote 0
      • R Offline
        rmeskill
        last edited by

        @paddyhughes said in Error on npm install:

        I just installed a module and it asked me to update NPM think i did it in the root directory not MagicMirror one can be sure.
        This is what worked for me
        sudo npm i -g npm

        sudo npm i -g npm didn’t work for me, got this error:

        pi@raspberrypi:~ $ sudo npm i -g npm
        /usr/local/lib/node_modules/npm/bin/npm-cli.js:85
              let notifier = require('update-notifier')({pkg})
              ^^^
        
        SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
            at exports.runInThisContext (vm.js:53:16)
            at Module._compile (module.js:414:25)
            at Object.Module._extensions..js (module.js:442:10)
            at Module.load (module.js:356:32)
            at Function.Module._load (module.js:311:12)
            at Function.Module.runMain (module.js:467:10)
            at startup (node.js:134:18)
            at node.js:961:3
        

        Trying just with npm i -g npm instead…

        P 1 Reply Last reply Reply Quote 0
        • R Offline
          rmeskill
          last edited by

          @rmeskill said in Error on npm install:

          Trying just with npm i -g npm instead…

          Did give me a positive output:

          Trying just with npm i -g npm instead…
          

          Trying npm install again…

          1 Reply Last reply Reply Quote 0
          • P Offline
            paddyhughes @rmeskill
            last edited by

            @rmeskill try do it in the MagicMirror folder
            sudo npm i -g npm

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

              @paddyhughes -g means global, not mm specific.

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • R Offline
                rmeskill
                last edited by

                @paddyhughes said in Error on npm install:

                @rmeskill try do it in the MagicMirror folder
                sudo npm i -g npm

                Sudo still doesn’t work, but I tried it again just ‘npm i -g npm’ in the MagicMirror folder. Now I’m trying npm install again in the MagicMirror folder again, so I guess we’ll see, but it looks like it’s stuck at the same point as last time

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

                  @rmeskill looks like node is also downlevel

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    rmeskill
                    last edited by

                    @sdetweil said in Error on npm install:

                    @rmeskill looks like node is also downlevel

                    Do you mean I should upgrade it? this isn’t enough:

                    pi@raspberrypi:~/MagicMirror $ node -v
                    v11.6.0
                    
                    S 1 Reply Last reply Reply Quote 0
                    • S Offline
                      sdetweil @rmeskill
                      last edited by

                      @rmeskill that is a surprise

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • R Offline
                        rmeskill
                        last edited by

                        Now I’m trying to remove npm and nodejs to start again, but even after I’ve run apt-get remove npm nodejs I still get this:

                        pi@raspberrypi:~/MagicMirror $ which npm
                        /home/pi/.nvm/versions/node/v11.6.0/bin/npm
                        pi@raspberrypi:~/MagicMirror $ which node
                        /home/pi/.nvm/versions/node/v11.6.0/bin/node
                        
                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • 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