• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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 find module 'node-fetch' error with MMM-SoccerLiveScore

Scheduled Pinned Locked Moved Solved Troubleshooting
34 Posts 5 Posters 8.1k Views 5 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.
  • K Offline
    KristjanESPERANTO Module Developer @karsten13
    last edited by Jan 2, 2024, 8:07 PM

    I created a PR to fix this, let’s see when @0m4r accept it.

    S 0 2 Replies Last reply Jan 2, 2024, 8:08 PM Reply Quote 1
    • S Away
      sdetweil @KristjanESPERANTO
      last edited by Jan 2, 2024, 8:08 PM

      @KristjanESPERANTO well, npm install would have installed the devDependencies too…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      K K 2 Replies Last reply Jan 2, 2024, 8:12 PM Reply Quote 0
      • K Offline
        KristjanESPERANTO Module Developer @sdetweil
        last edited by Jan 2, 2024, 8:12 PM

        @sdetweil Sure. But my PR removes node-fetch, so npm install is no longer necessary for this module.

        1 Reply Last reply Reply Quote 1
        • K Offline
          karsten13 @sdetweil
          last edited by Jan 2, 2024, 8:27 PM

          @sdetweil

          well, npm install would have installed the devDependencies too…

          This sentence clicked in my brain.

          I have NODE_ENV=production as default in my images (expect images I use for testing) and with this

          • npm install will install nothing
          • npm install node-fetch@2 will install nothing

          so @codac please go again in the folder of the module and run NODE_ENV=test npm install node-fetch@2

          this should hopefully solve the issue

          C 1 Reply Last reply Jan 2, 2024, 8:40 PM Reply Quote 1
          • C Offline
            codac @codac
            last edited by Jan 2, 2024, 8:37 PM

            @karsten13
            @codac said in Cannot find module 'node-fetch' error with MMM-SoccerLiveScore:

            @sdetweil

            root@04492d039b9f:/opt/magic_mirror/modules# cd MMM-SoccerLiveScore              
            root@04492d039b9f:/opt/magic_mirror/modules/MMM-SoccerLiveScore# npm install node
            -fetch@2                                                                         
                                                                                             
            up to date, audited 1 package in 1s                                              
                                                                                             
            found 0 vulnerabilities                                                         
            

            How would I restart MM of the container?
            pm2 is not set up.

            DISPLAY=:0 npm restart
            

            …results in

            > magicmirror@2.26.0 restart                                                     
            > npm stop --if-present && npm start                                             
                                                                                             
                                                                                             
            > magicmirror@2.26.0 start                                                       
            > DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js           
                                                                                             
            sh: 1: ./node_modules/.bin/electron: not found   
            
            1 Reply Last reply Reply Quote 0
            • C Offline
              codac @karsten13
              last edited by codac Jan 2, 2024, 8:41 PM Jan 2, 2024, 8:40 PM

              @karsten13 said in Cannot find module 'node-fetch' error with MMM-SoccerLiveScore:

              NODE_ENV=test npm install node-fetch@2

              I could see that this time node-fetch got installed (different than before running npm install node-fetch@2 only).
              But after restarting the docker container, the same error remained.

              1 Reply Last reply Reply Quote 0
              • K Offline
                karsten13
                last edited by Jan 2, 2024, 8:47 PM

                did the same and it works, so no idea anymore

                482fa9fe-04e1-40ca-8423-e141bf1bca99-grafik.png

                C 1 Reply Last reply Jan 2, 2024, 8:53 PM Reply Quote 0
                • C Offline
                  codac @karsten13
                  last edited by Jan 2, 2024, 8:53 PM

                  @karsten13 your are right… somehow the docker didn’t keep the installation after first try.
                  After installing it a second time and restarting the docker afterwards, the container kept the installation of node-fetch. Its working now.

                  Thank you guys for your massive support. Big time!
                  @karsten13, @sdetweil, @KristjanESPERANTO

                  1 Reply Last reply Reply Quote 2
                  • 0 Offline
                    0m4r Module Developer @KristjanESPERANTO
                    last edited by Jan 7, 2024, 9:22 AM

                    @KristjanESPERANTO thank you!
                    …and apologies for missing the whole discussion, I have updated my preferences to get e-mails when someone mentions me :)

                    https://github.com/0m4r

                    1 Reply Last reply Reply Quote 1
                    • 1
                    • 2
                    • 3
                    • 4
                    • 3 / 4
                    3 / 4
                    • First post
                      30/34
                      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