typicode / lowdb

Simple and fast JSON database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[ERR_REQUIRE_ESM]: require() of ES Module

dimaslanjaka opened this issue · comments

how to deal with this error ?

iam using typescript commonjs

lowdb ^3.0.0 in package.json

This seems to be a duplicate question (see https://github.com/typicode/lowdb/issues?q=is%3Aissue+ERR_REQUIRE_ESM).

You can check out this guide to solve it.

aghhhh... migrating whole project to esm module?.
impossible, many file typescripts that won't running in ESM module. (ive tried this)
can i downgrade to non-ESM lowdb ? which latest version non-esm ?

version 1 is stable and non ESM

done iam using version ^0.13.0

Looks like a lot of us are using version 1.

commented

I found this package.
I don't know the safety of this package, but it seems that lowdb can be used with commonjs by using this package.
https://www.npmjs.com/package/@commonify/lowdb