Read the statement by Michael Teeuw here.
Fetch is not a function
-
Dear all,
I have just update to 2.20.0 on an Ubuntu 20.04.3 LTS.
The news feed states “Geen nieuws op dit moment” sorry Dutch version, translated: “no news at this moment”.
The mm-error.log states “fetch is not a function” at fetchNews (/home/…/modules/default/newsfeed/newsfeedfetcher.js:88:3)
The changes for 2.20.0 by MichMich state:
Use internal fetch function of node instead external node-fetch library if used node version >= v18.node -v results in V14.19.3.
I think I am almost at solving the problem, but I am also way out of my depth here.
How do I get the newsfeed to “fetch” again on an Ubuntu 20.04.3 LTS mirror?
Help is apreciated.Kind Regards,
Hein-Jan
Sorry. Made a mess of package.json and package-lock.json files, and subsequently made a mess of the update.
Problem has been solved. -
@Hein-Jan update fails if any of our files are changed.
git status will show you the changed files, if any
git diff will show you WHAT changed in each changed file…
package-lock is regenerated, and thus changed
package.json is usually not changed, but needs to be for windows and pi0w.
you cannot restore the older package.json onto the newer release, as it contains the version info for the mm dependencies which change every release.I recommend using my upgrade script.
see https://github.com/sdetweil/MagicMirror_scripts
it will call out the changes and save them if need be (if u say yes).but that explains the trouble, mismatched dependencies…
-
@Hein-Jan what did u do to fix this?
-
I always struggle with the updates. The first time it fails because it tells me to store a package.json and and a package-lock.json. I renamed them by adding “_old”. The second time the updated ran its course.
As i am ignorant, the I renamed the new package.json and package-lock.json by adding “_new”, and renamed the “_old” ones into the package.json and package-lock.json.
Then I ran the npm install.
That’s when I ran into trouble and called for help.
Further study of the log showed me that I was still running 2.17, which indicated something had gone wrong with the update, so I now renamed the “_new” files into package.json and package-lock.json, and redid the npm install. That solved the fetch problem.
It just gave me a valid-url and and another problem, but I simply installed these modules again, they always seem to be gone after an update in the Ubuntu install.To be honest I do not know why the updates halts and tells me to store the (or something) the package.json and package-lock.json files, when it needs the new ones to run the update proper.
To be honest I do not even know what the files do. They seem to be a record of the dependcies or something.
Like I said: I am ignorant.Thanks for reading and replying to mu mail, I see that you help a lot of people. Hope this info helps you keeping up that service.
Kind Regards,
Hein-Jan
-
@Hein-Jan update fails if any of our files are changed.
git status will show you the changed files, if any
git diff will show you WHAT changed in each changed file…
package-lock is regenerated, and thus changed
package.json is usually not changed, but needs to be for windows and pi0w.
you cannot restore the older package.json onto the newer release, as it contains the version info for the mm dependencies which change every release.I recommend using my upgrade script.
see https://github.com/sdetweil/MagicMirror_scripts
it will call out the changes and save them if need be (if u say yes).but that explains the trouble, mismatched dependencies…
-
You need to update node version at least v18.
I recommend using nvm to manage node versions. -
@MMRIZE node 16 is acceptable.
-