Skip to content

Quick fix to install @types/node on import * as fs from 'fs';  #23224

Closed
@mjbvz

Description

@mjbvz

microsoft/vscode#47321

TypeScript Version: 2.9.0-dev.20180404

Search Terms:

  • @types/node
  • Quick fix
  • typings install

Code

In a new folder

  1. npm init -y

  2. tsc --init

  3. touch index.ts

  4. index.ts:

    import * as fs from 'fs'; 

Expected behavior:
Error show. Quick fix can be used to install @types/node in project

Actual behavior:
Error shown: cannot find module fs

Playground Link:

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issueSuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions