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

Broken update to lowdb #389

Closed
JP-Garcia opened this issue Oct 1, 2024 · 3 comments · May be fixed by #390
Closed

Broken update to lowdb #389

JP-Garcia opened this issue Oct 1, 2024 · 3 comments · May be fixed by #390

Comments

@JP-Garcia
Copy link

Getting this error after pulling changes today:

file:///D:/Dev/free-games-claimer/src/util.js:14
import { JSONFilePreset } from 'lowdb/node';
         ^^^^^^^^^^^^^^
SyntaxError: The requested module 'lowdb/node' does not provide an export named 'JSONFilePreset'

Screenshot 2024-09-30 194638

Saw the same problem here:
typicode/lowdb#554

This change in src/util.js fixed it for me:

import { LowSync } from "lowdb";
import { JSONFileSync } from "lowdb/node";
export const jsonDb = (file, defaultData) => new LowSync(new JSONFileSync(dataDir(file)), defaultData);
@vogler
Copy link
Owner

vogler commented Oct 1, 2024

What update? Last update to lowdb was 4 months ago and it's been working fine for me since then: f0f1427
Did you forget to npm install to get the correct version?

@JP-Garcia
Copy link
Author

Haha you're right, and its been almost a year since I pulled changes. I don't like messing with npm so I didn't even look 😶‍🌫️.

@vogler
Copy link
Owner

vogler commented Dec 30, 2024

If you don't have local changes to the code, git pull && npm install should always work to update everything.
Since dependencies are only installed locally into node_modules, it shouldn't have any effect on anything else on your system.

@vogler vogler closed this as completed Dec 30, 2024
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

Successfully merging a pull request may close this issue.

2 participants