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 trying to run: npm run install-mm

    Scheduled Pinned Locked Moved Solved Troubleshooting
    18 Posts 2 Posters 8.0k 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.
    • L Offline
      lvolkjr
      last edited by

      I’m trying to install MagicMirror on my Pi 4 - Buster and when I put in npm run install-mm while I’m in the MagicMirror folder I get the following:

      evalmachine.:36
      } = primordials;
      ^

      ReferenceError: primordials is not defined
      at evalmachine.:36:5
      at Object. (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/fs.js:11:8)
      at Module._compile (internal/modules/cjs/loader.js:999:30)
      at Object.Module._extensions…js (internal/modules/cjs/loader.js:1027:10)
      at Module.load (internal/modules/cjs/loader.js:863:32)
      at Function.Module._load (internal/modules/cjs/loader.js:708:14)
      at Module.require (internal/modules/cjs/loader.js:887:19)
      at require (internal/modules/cjs/helpers.js:74:18)
      at Object. (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:3:27)
      at Module._compile (internal/modules/cjs/loader.js:999:30)

      How do I resolve this issue? I’m new to this.

      S 1 Reply Last reply Reply Quote 0
      • S Do not disturb
        sdetweil @lvolkjr
        last edited by sdetweil

        @lvolkjr I expected something too

        I’d rebuild the SD card, boot, skip updates

        then use my script. this node install is such a mess, they changed the process…ugh

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        L 1 Reply Last reply Reply Quote 0
        • S Do not disturb
          sdetweil @lvolkjr
          last edited by

          @lvolkjr yeh, SO much fun…

          take off nodejs

          sudo apt-get remove nodejs npm -y
          

          then
          node -v
          should return commands not found ,or some old version number maybe 12…

          then run my install script…
          see https://github.com/sdetweil/MagicMirror_scripts

          it will install the correct version of nodejs and npm

          Sam

          How to add modules

          learning how to use browser developers window for css changes

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

            @sdetweil I ran node -v and got the following:
            bash: /usr/bin/node: No such file or directory

            Then I ran your install script and got this:
            install log being saved to /home/lowell/install.log
            Updating packages …
            [ <=> ]
            Installing helper tools …
            installing correct version of node and npm, please wait
            sudo: n: command not found
            node failed to install, exiting

            S 1 Reply Last reply Reply Quote 0
            • S Do not disturb
              sdetweil @lvolkjr
              last edited by

              @lvolkjr sorry

              can u do

              ls /usr/bin/node -laF

              if not present do
              hash -r

              then node -v again

              also show me output of

              uname -a
              lsb_release -a
              file /bin/bash

              Sam

              How to add modules

              learning how to use browser developers window for css changes

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

                @sdetweil My bad I said Buster earlier, It’s Bullseye. I went back a version because I needed VNC server to work.

                lowell@raspberrypi:~/MagicMirror $ ls /usr/bin/node -laF
                -rwxr-xr-x 1 root root 80547788 Oct 13 07:03 /usr/bin/node*
                lowell@raspberrypi:~/MagicMirror $ node -v
                v18.18.2
                lowell@raspberrypi:~/MagicMirror $ uname -a
                Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
                lowell@raspberrypi:~/MagicMirror $ lsb_release -a
                No LSB modules are available.
                Distributor ID: Raspbian
                Description: Raspbian GNU/Linux 11 (bullseye)
                Release: 11
                Codename: bullseye
                lowell@raspberrypi:~/MagicMirror $ file /bin/bash
                /bin/bash: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, BuildID[sha1]=f12e6d40fb262ad0037b6ec43162208b76d4da71, for GNU/Linux 3.2.0, stripped

                S 1 Reply Last reply Reply Quote 0
                • S Do not disturb
                  sdetweil @lvolkjr
                  last edited by sdetweil

                  @lvolkjr ok, try this

                  which node
                  n ls
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

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

                    @sdetweil
                    lowell@raspberrypi:~/MagicMirror $ which node
                    /usr/bin/node
                    lowell@raspberrypi:~/MagicMirror $ n ls
                    bash: n: command not found

                    S 1 Reply Last reply Reply Quote 0
                    • S Do not disturb
                      sdetweil @lvolkjr
                      last edited by

                      @lvolkjr ok, thx… but how did you get to node 18? it doesn’t come as default.

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

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

                        @sdetweil I was looking for a solution prior to coming to this forum and following someone else’s answer to there own issue that I thought would work for me, but got me no where. they said to change to node 18 from here: https://github.com/nodesource/distributions

                        Download and import the Nodesource GPG key
                        

                        sudo apt-get update
                        sudo apt-get install -y ca-certificates curl gnupg
                        sudo mkdir -p /etc/apt/keyrings
                        curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg

                        Create deb repository
                        

                        NODE_MAJOR=20
                        echo “deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main” | sudo tee /etc/apt/sources.list.d/nodesource.list

                        Optional: NODE_MAJOR can be changed depending on the version you need.

                        NODE_MAJOR=16
                        NODE_MAJOR=18
                        NODE_MAJOR=20
                        NODE_MAJOR=21

                        Run Update and Install
                        

                        sudo apt-get update
                        sudo apt-get install nodejs -y

                        Did this screw me up?

                        S 1 Reply Last reply Reply Quote 0
                        • S Do not disturb
                          sdetweil @lvolkjr
                          last edited by sdetweil

                          @lvolkjr said in Error trying to run: npm run install-mm:

                          Did this screw me up?

                          maybe…

                          try this

                          sudo apt-get remove nodejs -y
                          

                          then do
                          node -v

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

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

                            @sdetweil I didn’t see any errors after running sudo apt-get remove nodejs -y
                            When I run node -v I get this:
                            bash: /usr/bin/node: No such file or directory

                            S 1 Reply Last reply Reply Quote 0
                            • S Do not disturb
                              sdetweil @lvolkjr
                              last edited by

                              @lvolkjr ok, do

                              ls /usr/bin/node

                              should return file not found
                              do
                              hash -r
                              node -v

                              just to make sure…
                              then run my install or upgrade script as appropriate…

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

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

                                @sdetweil This is what I got:
                                lowell@raspberrypi:~ $ ls /usr/bin/node
                                ls: cannot access ‘/usr/bin/node’: No such file or directory
                                lowell@raspberrypi:~ $ hash -r
                                lowell@raspberrypi:~ $ node -v
                                bash: node: command not found

                                Do you still want me to run your script? I feel like node -v should have given me a different output, like the version number.

                                S 1 Reply Last reply Reply Quote 0
                                • S Do not disturb
                                  sdetweil @lvolkjr
                                  last edited by sdetweil

                                  @lvolkjr I expected something too

                                  I’d rebuild the SD card, boot, skip updates

                                  then use my script. this node install is such a mess, they changed the process…ugh

                                  Sam

                                  How to add modules

                                  learning how to use browser developers window for css changes

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

                                    @sdetweil Yea, I figured. Thanks for all your help. Hopefully I could repay you in the future. I’ll keep you updated to what happens.

                                    L 1 Reply Last reply Reply Quote 0
                                    • L Offline
                                      lvolkjr @lvolkjr
                                      last edited by

                                      @sdetweil Thanks!!! That worked! I’m running MagicMirror and getting ready to customize it. I should have started over a long time ago.

                                      S 1 Reply Last reply Reply Quote 0
                                      • S Do not disturb
                                        sdetweil @lvolkjr
                                        last edited by

                                        @lvolkjr cool… yeh, its hard to tell when you’ve hit a real roadblock

                                        glad you are working now… make sure to backup!!..

                                        see https://github.com/sdetweil/MagicMirror-backup-restore

                                        Sam

                                        How to add modules

                                        learning how to use browser developers window for css changes

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

                                          @sdetweil I will, thanks again.

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