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 regular .js npm packages #20649

Open
DanielRosenwasser opened this issue Dec 12, 2017 · 0 comments
Open

Quick fix to install regular .js npm packages #20649

DanielRosenwasser opened this issue Dec 12, 2017 · 0 comments
Labels
Domain: Quick Fixes Editor-provided fixes, often called code actions. In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Dec 12, 2017

Let's say I start a new project. I start writing out an import for, say, express because I'm certain I'll be using that, but I haven't bothered to install it yet.

import express from "express";

Immediately, I might get an error like Cannot find module 'express'. because I didn't install the package before using it. This happens regardless of if I have noImplicitAny on. But this means I have to switch to a terminal and do an npm install.

We already give a quick fix to install missing @types packages, we should have a fix that

  1. Gives the option of installing a missing package as a dependency or a dev dependency.
  2. Also installs the types for that package if necessary in the same fashion.
@DanielRosenwasser DanielRosenwasser added Domain: Quick Fixes Editor-provided fixes, often called code actions. Suggestion An idea for TypeScript labels Dec 12, 2017
@weswigham weswigham added the In Discussion Not yet reached consensus label Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Quick Fixes Editor-provided fixes, often called code actions. In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants