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

nordpool-ifttt does not run on Windows 10 #2

Open
skjerr opened this issue Dec 11, 2022 · 4 comments
Open

nordpool-ifttt does not run on Windows 10 #2

skjerr opened this issue Dec 11, 2022 · 4 comments

Comments

@skjerr
Copy link

skjerr commented Dec 11, 2022

No description provided.

@skjerr skjerr closed this as completed Dec 27, 2022
@skjerr
Copy link
Author

skjerr commented Jan 17, 2023

I am using this fix:
Unitech/pm2#4819 (comment)

@skjerr skjerr reopened this Feb 24, 2023
@skjerr
Copy link
Author

skjerr commented Feb 24, 2023

The changes januari 12 2023 caused the problem to come back and the fix does not work any longer.

@skjerr skjerr changed the title On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' nordpool-ifttt does not run on Windows 10 Mar 1, 2023
@skjerr
Copy link
Author

skjerr commented Mar 1, 2023

Issue
nordpool-ifttt does not run on Windows 10

Software
Program executed https://github.com/samuelmr/nordpool-ifttt
Commits on Jan 26, 2023

Node.js and npm https://nodejs.org/dist/v18.12.1/node-v18.12.1-win-x64.zip
npm version 8.19.2

Git https://git-scm.com/download/win
Git-2.38.1-64-bit

Computer and OS
Enhetsnamn PC7
Processor Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz 2.40 GHz
Installerat RAM-minne 8,00 GB (7,88 GB går att använda)
Enhets-ID 9C8BB8E3-710F-4D7D-96E2-56E9ACE03D82
Produkt-ID 00325-81504-52137-AAOEM
Systemtyp 64-bitars operativsystem, x64-baserad processor

Utgåva Windows 10 Home
Version 22H2
Installerad ‎2020-‎01-‎29
OS-version 19045.2604
Serienummer PF1DB99N
Gränssnitt Windows Feature Experience Pack 120.2212.4190.0

Reproduce

config.js =
const config = {
area: 'SE3', // see http://www.nordpoolspot.com/maps/
currency: 'SEK', // can also be 'DKK', 'NOK', 'SEK'
currencySubUnit: 'öre', // 1/100 of currency, used to format the message passed to IFTTT, can be 'cents', 'öre', 'øre', ...
highTreshold: 131, // send event when price > highTreshold
lowTreshold: 123, // send event when price < lowTreshold
maxHighHours: 24, // max consecutive high hours
maxLowHours: 24, // max consecutive low hours
vatPercent: 0, // if you want prices including value-added tax (VAT), enter the percentage here
iftttKey: 'Your own key',
// see https://ifttt.com/services/maker_webhooks/settings
debugLevel: 4
};
export {config};

Run
Start with npm start.
The execution stops with the following error message in:
~.pm2\logs\Nordpool-IFTTT-trigger-error-0.log

SyntaxError: Named export 'nordpool' not found. The requested module 'nordpool' is a CommonJS module, which may not support all module.exports as named exports.
0|Nordpool | CommonJS modules can always be imported via the default export, for example using:
0|Nordpool |
0|Nordpool | import pkg from 'nordpool';
0|Nordpool | const {nordpool} = pkg;

Fix
Change in index.js row 2:
Replace
import {nordpool} from 'nordpool';
by
import nordpool from 'nordpool';

Expected result
Start with npm start.
The execution continous without error message in:
~.pm2\logs\Nordpool-IFTTT-trigger-error-0.log

@samuelmr
Copy link
Owner

samuelmr commented Mar 1, 2023

Thanks for raising the issue! Should be fixed in 27dd859

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

2 participants