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.

    Looking for package.json in all the wrong places

    Scheduled Pinned Locked Moved Solved Troubleshooting
    9 Posts 3 Posters 1.1k 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.
    • H Offline
      HALPi-Thousand
      last edited by HALPi-Thousand

      Hi, Guys -
      I’m trying to run Magic Mirror on a Pi 4b. I followed the install instructions perfectly, but I keep getting this error:

      pi@HALpiThousand:~ $ npm start
          npm ERR! **path /home/pi/package.json**
          npm ERR! code ENOENT
          npm ERR! errno -2
          npm ERR! syscall open
          npm ERR! enoent ENOENT: **no such file or directory, open '/home/pi/package.json'**
          npm ERR! enoent **This is related to npm not being able to find a file.** 
      

      So, it can’t find the file. I found the file. It’s in the Magic Mirror folder, right where it should be. For whatever reason, MM hasn’t thought to look there. Any idea on how to teach it geography?

      Fair warning, I am somewhere on the opposite end of the programming spectrum from anyone who knows what they’re doing.

      Thanks

      mumblebajM 1 Reply Last reply Reply Quote 0
      • mumblebajM Offline
        mumblebaj Module Developer @HALPi-Thousand
        last edited by

        @halpi-thousand You need to be in the MagicMirror folder to run npm start. cd ~/MagicMirror then npm start

        Check out my modules at: https://github.com/mumblebaj?tab=repositories

        H 2 Replies Last reply Reply Quote 0
        • H Offline
          HALPi-Thousand @mumblebaj
          last edited by

          @mumblebaj

          Funny thing, after I wrote that, I deleted and reinstalled Magic Mirror, then remembered that during an earlier install, I might not have done that directory change.

          So now, it may be that it’s looking in the main Pi home folder, even though I’ve installed it the right way twice or three times since then.

          So, I guess the question is, how do I let it know that the file is where it should be? Is there something else I should delete from somewhere else? Something that got installed in the main home folder and is probably still there?

          Also, on this last install, I got this message:

          pi@HALpiThousand:~/MagicMirror $ npm install
          npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it
          
          > playwright@1.17.1 install /home/pi/MagicMirror/node_modules/playwright
          > node install.js
          
          internal/util.js:220
              throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'Function');
              ^
          
          TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type Function
              at promisify (internal/util.js:220:11)
              at Object.<anonymous> (/home/pi/MagicMirror/node_modules/playwright-core/node_modules/extract-zip/index.js:11:18)
              at Module._compile (module.js:649:30)
              at Object.Module._extensions..js (module.js:660:10)
              at Module.load (module.js:561:32)
              at tryModuleLoad (module.js:501:12)
              at Function.Module._load (module.js:493:3)
              at Module.require (module.js:593:17)
              at require (internal/module.js:11:18)
              at Object.<anonymous> (/home/pi/MagicMirror/node_modules/playwright-core/lib/utils/browserFetcher.js:9:42)
          npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
          npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})
          
          npm ERR! code ELIFECYCLE
          npm ERR! errno 1
          npm ERR! playwright@1.17.1 install: `node install.js`
          npm ERR! Exit status 1
          npm ERR! 
          npm ERR! Failed at the playwright@1.17.1 install 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/2022-01-28T17_50_58_671Z-debug.log
          
          

          Does this help any with that question?

          Thanks

          1 Reply Last reply Reply Quote 0
          • H Offline
            HALPi-Thousand @mumblebaj
            last edited by

            @mumblebaj

            I think I’ve found the cuse of the problem. it begins at the npm install part:

            pi@HALpiThousand:~/MagicMirror $ npm install
            npm WARN read-shrinkwrap This version of npm is compatible with **lockfileVersion@1**, but package-lock.json was generated for **lockfileVersion@2**. I'll try to do my best with it!
            

            So, it looks like, for whatever reason, it keeps doing that, and that results in it having problems trying to use it.

            So, I guess the question is, what exactly is lockfile, what’s the deal with it putting this package in V@2 instead of V@1, and how can I get it to do what it’s supposed to do with it?

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

              @halpi-thousand do

               npm install --only=prod
              

              playwright is a testing tool for development purposes

              if you used my scripted install it would have done the same

              see
              https://github.com/sdetweil/MagicMirror_scripts

              u may have the wrong version of npm which s causing the problem.

              mm needs v16

              bullseye comes w v12

              my script handles the upgrade too

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              H 1 Reply Last reply Reply Quote 0
              • H Offline
                HALPi-Thousand @sdetweil
                last edited by

                @sdetweil

                I’m still running Buster; tried Bullseye, ran into issues. Decided to wait a few versions. Will your script work with Buster as well, or just Bullseye?

                Thanks

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

                  @halpi-thousand yes, and Mac, and any linux

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  H 1 Reply Last reply Reply Quote 0
                  • H Offline
                    HALPi-Thousand @sdetweil
                    last edited by HALPi-Thousand

                    @sdetweil

                    So, I tried using that install script, ran into a few problems.

                    First I should mention that I did have a successful install of Magic Mirror at one point recently. Found Mystic Mirror, which apparently includes Alexa, which I want, so I deleted Magic and went to install Mystic, but ran into a bit of trickiness, so I installed Magic (or thought I did) until I could work out what to do with Mystic. And that’s around when I started running into this npm problem. Might have skipped something somewhere or gotten somethign wrong, I really don’t recall.

                    —edit----
                    You were about to be wading through a ton of text copied from the Terminal, but I somehow managed to figure out the right thing to google, and realizing that node.js was the first thing it had problems with, found out how to get rid of it. That worked. I did the full Magic Mirror installation again, and it’s happy. Just thought I’d mention the solution here.

                    I’ll take a swing at using your install scripts in a bit, but for now the main problem is solved. Victory!

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

                      @halpi-thousand no need to run my script if u have it.

                      read this about alexa

                      https://forum.magicmirror.builders/topic/16069/alexa-implementations-now-more-difficult-and-some-features-will-stop-working

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 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