Skip to content

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

Closed

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:

Activity

  1. mhegazy commented on Apr 6, 2018

    @mhegazy
    Contributor

    We have a list of node builtin modules in https://github.com/Microsoft/TypeScript/blob/master/src/services/jsTyping.ts#L42, we should do something similar for the quickfix.

  2. mhegazy commented on Apr 26, 2018

    @mhegazy
    Contributor

    related to #21933

  3. ghost closed this as completedin #23807on May 1, 2018
  4. locked and limited conversation to collaborators on Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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