I just tried to use import fs from 'node:fs' with TypeScript but the TypeScript compiler tells me "TS2307: Cannot find module 'node:fs' or its corresponding type declarations.". Do you know what I am doing wrong?
Hi , it supported in TypeScript by the latest versions of @types/node. However I haven't try in Typescript yet. Maybe you can double check on the @types/node version you are using. You may refer the Github issue here
I just tried to use
import fs from 'node:fs'
with TypeScript but the TypeScript compiler tells me "TS2307: Cannot find module 'node:fs' or its corresponding type declarations.". Do you know what I am doing wrong?Hi , it supported in TypeScript by the latest versions of
@types/node
. However I haven't try in Typescript yet. Maybe you can double check on the@types/node
version you are using. You may refer the Github issue hereCool. I just tried it wih
@types/node
v16.11.20 and can confirm it works! I suggest adding it to your article. Thanks for showing me this! :)Great👏🎉. Thank you for the verify too. I already added into the article. 😊