How to find module “fs” in VS Code with TypeScript?

前端 未结 6 1794
一生所求
一生所求 2021-01-30 12:17

I\'m running on a MacBook Air. I installed VS Code as an IDE and also have TypeScript installed.

I have a simple file with just this line:

import fs = req         


        
6条回答
  •  别那么骄傲
    2021-01-30 12:53

    Typescript knows about modules based upon conventions , check Module resolution for more detail.

    Also for IDE to know about fs module, you have to provide typings for node.

    Also check this github issue

提交回复
热议问题