I have som problems shown below.
Think i need to do som update regarding nodes to make it run?
Thanks in advance
BR
Jonas
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/jontegubben/automatisering/nordpool-ifttt/index.js
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1015:13)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at /home/jontegubben/automatisering/nordpool-ifttt/node_modules/pm2/lib/ProcessContainer.js:303:25
at wrapper (/home/jontegubben/automatisering/nordpool-ifttt/node_modules/async/internal/once.js:12:16)
at next (/home/jontegubben/automatisering/nordpool-ifttt/node_modules/async/waterfall.js:96:20)
at /home/jontegubben/automatisering/nordpool-ifttt/node_modules/async/internal/onlyOnce.js:12:16
at WriteStream. (/home/jontegubben/automatisering/nordpool-ifttt/node_modules/pm2/lib/Utility.js:186:13)
at WriteStream.emit (events.js:314:20)
at internal/fs/streams.js:366:10
It would help if you could tell us what you did when this error appears?
Looks like your node package.json contains a line
“type”: “module”
In that way you cannot use require to add new dependencies. You need to use import. Mostly its only another syntax: But as we do not know what you have done we cannot help more
I think the instructions on the repo are slightly unclear in that they have you installing the dependencies before you change into the correct directory.
Here’s what I did:
git clone https://github.com/samuelmr/nordpool-ifttt
cd nordpool-ifttt
npm install
cp config-sample.js config.js
npm run start
Hello
Thanks for your support.
This program is used for reading out the spot price for electricuty at nordpool and send webhooks when the price is high/low and normal.
This can I then use in ifttt to automaticly start stop the heating in my house.
I have fixed price now snd unti 20231130, so I have more the a year to make it work.
I will follow your instructions and see if itcworks for me now.
Acually James I have the same function as you also from the beginning.
But if you look in the logs in the hidden direcory .pm2 you can se that the output log is empty and the debug log contanin the error that mentioned
from the beginning
Last post is the direcories
All the files are at
Hemma/autmatisering/nordpool-ifttt
And I start the script with “npm run start”, in above folder but the debuglog contain the same errors
And ~/.pm2/logs/Nordpool-IFTTT-trigger-error-0.log is empty.
I tried downgrading to Node v12.22.9 and npm v8.5.1, but I could not reproduce the error.
Sorry
Perhaps you could try upgrading to the latest Node and newest version of npm? See if that helps…
Otherwise, try Googling the error and see if that takes you anywhere.
Thank for the tip
I forced in the latest versions
Sudo npm install npm@version
The same for node …
So now it works and my knowledge has increased with 500 %