KristjanESPERANTO / MMM-PublicTransportHafas

This is a module for MagicMirror² to display public transport departures.
MIT License
21 stars 6 forks source link

Issue after latest update #161

Closed DrYoatGitHub closed 7 months ago

DrYoatGitHub commented 9 months ago

First of all I would like to thank you for maintaining this module - really awesome! It was the first module which I integrated in my MagicMirror during Christmas time :-) Up to now never had any problems with the updates of the module - until today... Getting the following error message:


mmm-publictransporthafas@2.0.4 prepare husky

sh: 1: husky: not found npm ERR! code 127 npm ERR! path /home/my_pi_user/MagicMirror/modules/MMM-PublicTransportHafas npm ERR! command failed npm ERR! command sh -c husky

npm ERR! A complete log of this run can be found in: /home/my_pi_user/.npm/_logs/2024-02-04T11_09_41_774Z-debug-0.log


Nevertheless the module is running fine... As I'm a newbie in this stuff (just created a GitHub account...) would appreciate advice. Many Thanks and have a nice weekend! Dr. Yo

KristjanESPERANTO commented 9 months ago

Thank you for the appreciation :slightly_smiling_face: and for taking the time to open an issue here!

Unfortunately, I cannot reproduce the error on my system. When exactly does it occur? When you run git pull? Or with npm install --omit=dev?

Please delete the node_modules directory and the package-lock.json file in the module directory and then run git pull and npm install --omit=dev again? If this isn't working, try npm install.

The results would be interesting because the problem may also occur with other users.

just created a GitHub account

It would be nice if you could give the modules you like a star, it's a small but nice gesture to the developers :slightly_smiling_face: The stars have recently been added to the new module list I am working on.

DrYoatGitHub commented 9 months ago

Star awarded 👍

The error occurs with npm install --omit=dev and is reproducible today.

Deleted node_modules directory and package-lock.json file, pulled from git and installed again => same error

Then tried the npm install => runs perfectly through 👍 😄

Thanks for your support!

KristjanESPERANTO commented 9 months ago

Okay, thanks for the feedback! I have just adjusted the README accordingly :slightly_smiling_face:

b1nary-b0b commented 7 months ago

Hey,

i have the same issue, it appears on all three NMP commands with freshly pulled git.

All cause the same issue: }

mmm-publictransporthafas@2.1.0 prepare husky

file:///var/lib/docker/volumes/magicmirror_modules/_data/MMM-PublicTransportHafas/node_modules/husky/bin.mjs:14 ;(o.scripts ||= {}).prepare = 'husky' ^

SyntaxError: Unexpected token '=' at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) at async link (internal/modules/esm/module_job.js:42:21) npm ERR! code 1 npm ERR! path /var/lib/docker/volumes/magicmirror_modules/_data/MMM-PublicTransportHafas npm ERR! command failed npm ERR! command sh -c husky

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2024-03-30T23_25_59_648Z-debug-0.log

Can you please check what might be the issue?

Thanks for your help!

KristjanESPERANTO commented 7 months ago

Please try this as a quick solution:

npm install husky
npm ci

I will look into it later to find a proper solution.

b1nary-b0b commented 7 months ago

Thanks for the lighting fast answer.

unfortunately, still nothing new. The issue persists, even when installing husky before Appreciate the help! :)

KristjanESPERANTO commented 7 months ago

Okay, I just changed something.

Please try this in the directory of the module:

git pull
npm ci
KristjanESPERANTO commented 7 months ago

If that doesn't work. Delete the module directory and reinstall it.

b1nary-b0b commented 7 months ago

Hey I just removed the folder and pulled it again and run npm ci. Now it works. Thanks! :)

KristjanESPERANTO commented 7 months ago

Nice that you were able to solve it.