typicode / lowdb

Simple and fast JSON database
MIT License
21.56k stars 924 forks source link

error TS1192: Module '"node:fs"' has no default export. #584

Closed axi92 closed 11 months ago

axi92 commented 11 months ago

I don't know if my setup is the problem but I get this error from my nest project.

If I change the imports to: import { PathLike } from 'node:fs'; and replace all fs.PathLike with PathLike it works.

https://github.com/typicode/lowdb/blob/main/src/adapters/node/TextFile.ts#L1 https://github.com/typicode/lowdb/blob/main/src/presets/node.ts#L1

If this is not a valid issue and my setup is the problem, please let me know - first time working with typescript.

typicode commented 11 months ago

I don't know but it doesn't hurt to be consistent with the rest of imports. So I've changed imports, it should be good in v7 ;)