-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
I use Nodejs v20.15.0
When I add the library I get the following issues:
Code:
import { PersistentNodeCache } from "persistent-node-cache";
const cache = new PersistentNodeCache("mycache", 1000);
cache.set("mykey", "myval", 1000); //true
cache.get("mykey");
Error:
import { PersistentNodeCache } from "persistent-node-cache";
^^^^^^^^^^^^^^^^^^^
SyntaxError: Named export 'PersistentNodeCache' not found. The requested module 'persistent-node-cache' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
Alternative is the following:
Code:
import pkg from 'persistent-node-cache';
const { PersistentNodeCache } = pkg;
const cache = new PersistentNodeCache("mycache", 1000);
cache.set("mykey", "myval", 1000); //true
cache.get("mykey");
Error:
Error writing to file: [Error: EINVAL: invalid argument, write] {
errno: -22,
code: 'EINVAL',
syscall: 'write'
}
Am I missing something? The permissions are set correctly.
Metadata
Metadata
Assignees
Labels
No labels