flow
flow copied to clipboard
Cannot resolve module node:fs
Missing/Incorrect APIs
Flow doesn't support node:
imports such as:
import fs from 'node:fs';
Currently, the following error is thrown:
Cannot resolve module node:fs. [cannot-resolve-module]
The only supported syntax is the original version without node:
prefix:
import fs from 'fs';
This affects all Node.js imports, not just fs
.
Relevant documentation
See: https://nodejs.org/api/esm.html#node-imports
Hi,
as a temporary (or not so temporary) solution you could install flow-typed node
environment.
https://flow-typed.github.io/flow-typed/#/env-definitions