Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mjbvz opened this issue Apr 6, 2018 · 2 comments
Closed

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

mjbvz opened this issue Apr 6, 2018 · 2 comments
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Apr 6, 2018

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:

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Apr 6, 2018
@mhegazy mhegazy added the Suggestion An idea for TypeScript label Apr 6, 2018
@mhegazy mhegazy assigned ghost Apr 6, 2018
@mhegazy mhegazy added this to the TypeScript 2.9 milestone Apr 6, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Apr 6, 2018

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.

@mhegazy
Copy link
Contributor

mhegazy commented Apr 26, 2018

related to #21933

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label May 1, 2018
@ghost ghost closed this as completed in #23807 May 1, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 31, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Fixed A PR has been merged for this issue Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants