---
title: "Discussion on \"Fix Cannot find module ‘fs’ or its corresponding type declarations.ts(2307)\" | Hashnode"
description: "Discussion on \"Fix Cannot find module ‘fs’ or its corresponding type declarations.ts(2307)\". I recently ran into the error “” while I was using VSCode and I was searching for a fix. Turns out all I needed to do was to add the definition file for node types in my project. Bash After that, reloading the window fixed the error! If you are still..."
url: "https://hashnode.com/posts/fix-cannot-find-module-fs-or-its-corresponding-type-declarationsts2307/65b185af3b2d0f14ffe19f60"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Fix Cannot find module ‘fs’ or its corresponding type declarations.ts(2307)](https://wisdomgeek.hashnode.dev/fix-cannot-find-module-fs-or-its-corresponding-type-declarationsts2307?utm_source=hashnode&utm_medium=feed)

I recently ran into the error “” while I was using VSCode and I was searching for a fix. Turns out all I needed to do was to add the definition file for node types in my project. Bash After that, reloading the window fixed the error! If you are still...

Jan 24, 2024 · 1 min read · wisdomgeek.hashnode.dev  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)

## Written by

[Wisdom Geek](https://hashnode.com/@wisdomgeek)

@wisdomgeek

  
[View profile](https://hashnode.com/@wisdomgeek)

Knowledge, Open Sourced

## Responses 1

Markdown supported · ⌘↵ to post

[Ndeye Fatou Diop](https://hashnode.com/@fatou)

[Jan 24, 2024](https://hashnode.com/posts/fix-cannot-find-module-fs-or-its-corresponding-type-declarationsts2307/65b185af3b2d0f14ffe19f60/comment/65b18a358f7f2c766175fd07)

Something that can also help in VSCode is to “Restart the Typescript server” command or restart the extension host

[Wisdom Geek](https://hashnode.com/@wisdomgeek)

[Jan 25, 2024](https://hashnode.com/posts/fix-cannot-find-module-fs-or-its-corresponding-type-declarationsts2307/65b185af3b2d0f14ffe19f60/comment/65b18a358f7f2c766175fd07#reply-65b236439a01518cfe396556)

Have used that to resolve other issues but a good callout in this case too. Thanks for your comment, I'll add it to the post!
