Hi, i want to use an external Node Libary (node-ical) in a script. My OpenHab (5.1.0) instance is running using official docker container. Following the documentation i installed npm in the container using nvm and installed the libary to /openhab/conf/automation/js & verified that the module was there under node_modules.
Next i tried to run a simple script using the libary:
// import ical
const ical = require('node-ical');
// or just parse some iCalendar data directly
const directEvents = ical.sync.parseICS(`
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
SUMMARY:Hey look! An example event!
DTSTART;TZID=America/New_York:20130802T103400
DTEND;TZID=America/New_York:20130802T110400
LOCATION:1000 Broadway Ave.\, Brooklyn
DESCRIPTION: Do something in NY.
STATUS:CONFIRMED
UID:7014-1567468800-1567555199@peterbraden@peterbraden.co.uk
END:VEVENT
END:VCALENDAR
`);
// log the ids of these events
console.log(Object.keys(directEvents));
Doing this, it seems there is an issue loading the node lib:
failed: java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.resolve(String)" because the return value of "java.nio.file.Path.getRoot()" is null
I checked the file permissions in the container and all seems fine.
I could only reference this error to an old beta version using google; so any idea would be appreciated.
Thanks Chris