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: ENOENT: no such file or directory, open 'package.json'

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    7 Posts 4 Posters 10.9k Views 4 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.
    • B Offline
      Benlism @Mykle1
      last edited by

      @Mykle1 I was using pm2 start, npm from the directory seems to work fine. Am trying some forum posts like https://stackoverflow.com/questions/24468041/npm-install-gives-error-cant-find-a-package-json-file but nothing has worked yet.

      Mykle1M 1 Reply Last reply Reply Quote 0
      • Mykle1M Offline
        Mykle1 Project Sponsor Module Developer @Benlism
        last edited by

        @Benlism

        Seeing that the last thing you were doing was “just playing around with stopping and starting with PM2, all was good. But I tried rebooting the pi to check the autoboot” let’s assume that PM2 is the problem. There are 2 common missed steps when installing PM2.

        1. is when the terminal actually gives you a command that you have to execute immediately after it is presented by the terminal.

        2. The other is not saving the state of PM2, in which case, it would not function properly, if at all.

        I’m not saying this is what happened. I’m just trying to narrow it down a bit

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • cruunnerrC Offline
          cruunnerr
          last edited by cruunnerr

          Unfortunately the pm2 start command can NOT be used in every direction. It must be used in the same direction where the “mm.sh” is. So if u create the mm.sh in your home directory u must also use “pm2 start mm.sh” in your home directory.
          (Just to know) :P

          Mykle1M idoodlerI 2 Replies Last reply Reply Quote 0
          • Mykle1M Offline
            Mykle1 Project Sponsor Module Developer @cruunnerr
            last edited by

            @cruunnerr said in Error: ENOENT: no such file or directory, open ‘package.json’:

            Unfortunately the pm2 start command can NOT be used in every direction.

            Tell that to my mirror, which executes pm2 start mm and pm2 stop mm in ANY directory.

            0_1515704798405_Capture.PNG

            Create a working config
            How to add modules

            1 Reply Last reply Reply Quote 1
            • idoodlerI Offline
              idoodler Module Developer @cruunnerr
              last edited by

              @cruunnerr @Mykle1 You both are right.

              @cruunnerr is executing the Shell script, which must be executed in the same directory as the script is located in, except you define the path in the pm2 command like this pm2 start /path/to/script.sh (also given, the script used absolute paths, or can handle the “remote” execution)

              @Mykle1 You are executing the pm2 “deamon”, which can be executed everywhere

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