DEV Community

Cover image for How to Install a Specific Version of an NPM Package
Brett Fisher
Brett Fisher

Posted on • Originally published at brettfisher.dev

1

How to Install a Specific Version of an NPM Package

The other day I got a warning in a Vue project I've been working on for a while. It was complaining about me using an unsupported version of TypeScript. I decided to download a supported version, but how was I supposed to do that?

First I uninstalled my existing version of TypeScript:

$ yarn remove typescript
Enter fullscreen mode Exit fullscreen mode

Then after some quick Googling, I found this for downloading a specific NPM package version:

$ yarn add typescript@3.5.3
Enter fullscreen mode Exit fullscreen mode

You can do the same thing with NPM:

$ npm install typescript@3.5.3
Enter fullscreen mode Exit fullscreen mode

And that's it! You can do this for any NPM package:

$ yarn add some-package@version
// or
$ npm install some-package@version
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay