Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module "valid-url" #64

Open
manshurtigh opened this issue Aug 1, 2023 · 10 comments
Open

Cannot find module "valid-url" #64

manshurtigh opened this issue Aug 1, 2023 · 10 comments

Comments

@manshurtigh
Copy link

Hi!

When trying to use this module I get the following error in the logs.

[01.08.2023 11:22.56.846] [ERROR] Error: Cannot find module 'valid-url'
Require stack:
- /opt/magic_mirror/modules/MMM-CalendarWeek/node_helper.js
- /opt/magic_mirror/js/app.js
- /opt/magic_mirror/serveronly/index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1075:15)
    at Module._resolveFilename (/opt/magic_mirror/node_modules/module-alias/index.js:49:29)
    at Module._load (node:internal/modules/cjs/loader:920:27)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/opt/magic_mirror/modules/MMM-CalendarWeek/node_helper.js:9:16)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at loadModule (/opt/magic_mirror/js/app.js:184:19)
    at loadNextModule (/opt/magic_mirror/js/app.js:220:6)
    at loadNextModule (/opt/magic_mirror/js/app.js:222:6)
    at loadNextModule (/opt/magic_mirror/js/app.js:222:6) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/magic_mirror/modules/MMM-CalendarWeek/node_helper.js',
    '/opt/magic_mirror/js/app.js',
    '/opt/magic_mirror/serveronly/index.js'
  ]
}

I am using the following configuration:

                {
                        module: "MMM-CalendarWeek",
                        position: "bottom_bar", // This can be any of the regions. Best results in bottom region.
                        header: "Calendars",
                        config: {
                                calendarTitle: "false",
                                maximumEntries: "20",
                                maximumNumberOfDays: "6",
                                displaySymbol: "true",
                                showEndDate: "true",
                                allowDuplicate: "false",
                                maxTitleLength: "25",
                                hideEmptyDays: "false",
                                wrapEvents: "false",
                                tableClass: "small",
                                calendars: [
                                        {
                                                url: "http://www.calendarlabs.com/templates/ical/US-Holidays.ics",
                                                symbol: "calendar"
                                        }
                                ]
                        }
                },
@akaep
Copy link

akaep commented Aug 2, 2023

Same issue. MM runs no problem with CalendarWeek commented out, but I'd really rather use it!

@dberntsson
Copy link

What happens if you run 'npm install valid-url' in your MagicMirror directory, and then restart your MagicMirror?

@manshurtigh
Copy link
Author

I am running my MagicMirror in docker (karsten13 image) with server only. When I start the MagicMirror container with the configuration provided in the first post the container just goes into a bootloop. Therefore I cannot connect to the console of the image and run npm install valid-url in the modules catalogue.

I have not had problems like this with any other modules and I am running over 6 different modules so it is probably an error within this module. Also, I am running the latest version of MagicMirror (2.24.0)

Maybe @akaep can try run npm install valid-url if he is using a "normal" installation instead of docker?

@manshurtigh
Copy link
Author

I found this fork by @ktoll2

master...ktoll2:MMM-CalendarWeek:master

Apparently missing dependencies. I started to use his fork instead. Now everything is working as expected.

Need to add dependencies in package.json to the master to get this plugin to work again. I will not close this comment in case anyone else have the same problem.

@dberntsson
Copy link

I know,
I have my own fork aswell since 6 months ago :)
https://github.com/dberntsson/MMM-CalendarWeek

And PR not accepted. So unfortunately this project isn't that well taken care of...

@manshurtigh
Copy link
Author

I switched to your fork. Cheers!

I think you should add your own fork on the 3rd party module so people can find a working version of the module.

@dberntsson
Copy link

Great
Should be visible here https://github.com/heskja/MMM-CalendarWeek/forks

@kelemvor33
Copy link

Great Should be visible here https://github.com/heskja/MMM-CalendarWeek/forks

I tried using your version and I get the same error as the original one. I deleted the mmm-calendarweek folder from within modules and then cloned yours but it didn't change anything. Is there anything else I need to do?

@OrangeGitHubber
Copy link

Great Should be visible here https://github.com/heskja/MMM-CalendarWeek/forks

I tried using your version and I get the same error as the original one. I deleted the mmm-calendarweek folder from within modules and then cloned yours but it didn't change anything. Is there anything else I need to do?

Same here, were you able to get it to work? I feel like there's a step I'm missing.....

@saraconache
Copy link

saraconache commented Apr 17, 2024

@OrangeGitHubber @kelemvor33
You need to enter the module folder and install it.
So after you clone the branch you do:
cd MMM-CalendarWeek
npm install

Also, thanks @dberntsson , Your fork came in clutch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants