Skip to content
FLAVIO COPES
flaviocopes.com
2026

Fix node modules import errors in VS Code

~~~

Got this error in VS Code?

Cannot find module 'fs' or its corresponding type declarations.ts(2307)

You need to include the definition file for node in your project.

Run this:

npm install --save-dev @types/node

and reload the VS Code window

~~~

Related posts about node: