# Fix node modules import errors in VS Code

> How to fix the Cannot find module fs error in VS Code by installing the @types/node package as a dev dependency and reloading the editor window.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2024-01-03 | Topics: [Node.js](https://flaviocopes.com/tags/node/), [Tools](https://flaviocopes.com/tags/tools/) | Canonical: https://flaviocopes.com/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
