Skip to content
Fix Code Error

How to install a previous exact version of a NPM package?

March 13, 2021 by Code Error
Posted By: Anonymous

I used nvm to download node v0.4.10 and installed npm to work with that version of node.

I am trying to install express using

npm install express -g

and I get an error that express requires node version >= 0.5.0.

Well, this is odd, since I am following the directions for a node+express+mongodb tutorial here that used node v0.4.10, so I am assuming express is/was available to node v0.4.10. If my assumption is correct, how do I tell npm to fetch a version that would work with my setup?

Solution

If you have to install an older version of a package, just specify it

npm install <package>@<version>

For example: npm install [email protected]

You can also add the --save flag to that command to add it to your package.json dependencies, or --save --save-exact flags if you want that exact version specified in your package.json dependencies.

The install command is documented here: https://docs.npmjs.com/cli/install

If you’re not sure what versions of a package are available, you can use:

npm view <package> versions

And npm view can be used for viewing other things about a package too. https://docs.npmjs.com/cli/view

Answered By: Anonymous

Related Articles

  • npm install error in vue
  • Table with table-layout: fixed; and how to make one…
  • Detect if Visual C++ Redistributable for Visual…
  • using d3.js with aurelia framework
  • Node Version Manager install - nvm command not found
  • nvm keeps "forgetting" node in new terminal session
  • How do I update Node.js?
  • Unexpected end of JSON input while parsing
  • How should I deal with "package '✘✘✘' is not…
  • Why the REPL is not showing the full trace of the…
  • How to use Elasticsearch with MongoDB?
  • Reinstall node using nvm on OS X without removing…
  • How to download Xcode DMG or XIP file?
  • How to stop mongo DB in one command
  • Can't Install Ember-CLI without sudo
  • How can I change the version of npm using nvm?
  • Polymer CLI build runs out of memory
  • Ubuntu apt-get unable to fetch packages
  • How do I completely uninstall Node.js, and reinstall…
  • Problems Installing CRA & NextJS from NPM…
  • How do I deal with installing peer dependencies in…
  • Npm run serve Error
  • Aurelia bundling issue with virtual directory
  • How can I find the product GUID of an installed MSI setup?
  • Unable to find module mongodb in simple node.js app
  • What version of MongoDB is installed on Ubuntu
  • Can't correctly import external JS into Aurelia…
  • Flutter: RenderBox was not laid out
  • Unable to create/open lock file: /data/mongod.lock…
  • Node.js Error: Cannot find module express
  • How can the default node version be set using NVM?
  • How to use module.exports in Next.js
  • Update MongoDB field using value of another field
  • Couldn't connect to server 127.0.0.1:27017
  • How to change to an older version of Node.js
  • how to set mongod --dbpath
  • How to change Windows 10 interface language on…
  • error LNK2005: ✘✘✘ already defined in…
  • How do I resolve `The following packages have unmet…
  • getting error while updating Composer
  • Download & Install Xcode version without Premium…
  • Export static NextJS App `TypeError: Cannot read…
  • Running Python on Windows for Node.js dependencies
  • npm install -g less does not work: EACCES: permission denied
  • MONGODB-ORG not running on UBUNTU 20.04
  • What's the difference between dependencies,…
  • MySQL vs MongoDB 1000 reads
  • How to fix "This is probably not a problem with npm.…
  • What algorithms compute directions from point A to…
  • Why does LiveReload not work in vue-cli project with…
  • SystemJS (Aurelia with jspm) fails to load…
  • How to properly upgrade node using nvm
  • Printing Even and Odd using two Threads in Java
  • NodeJS - Error installing with NPM
  • "Already up-to-date" and "Run 'yarn' to install…
  • How do I install Java on Mac OSX allowing version switching?
  • Download a file with Android, and showing the…
  • python 3.2 UnicodeEncodeError: 'charmap' codec can't…
  • Does "git fetch --tags" include "git fetch"?
  • How to listen for changes to a MongoDB collection?
  • SICP recursive let definition
  • How to download and save an image in Android
  • mongodb group values by multiple fields
  • Why do git fetch origin and git fetch : behave differently?
  • How to use azure-sb in aurelia
  • Relative imports for the billionth time
  • Unable to connect with Atlas cluster using PyMongo
  • Node Version Manager (NVM) on Windows
  • How to VueJS router-link active style
  • db.collection is not a function when using MongoClient v3.0
  • ExpressJS How to structure an application?
  • Homebrew install specific version of formula?
  • Smart way to truncate long strings
  • Mongodb: Failed to connect to 127.0.0.1:27017,…
  • Difference between npx and npm?
  • Node.js npm install express failed to fetch from registry
  • mongodb service is not starting up
  • next/node app deployment errors with heroku
  • Aurelia Typescript skeleton -navigation error with…
  • When to use MongoDB or other document oriented…
  • Webpack build error
  • MongoDB - admin user not authorized
  • Downloading Java JDK on Linux via wget is shown…
  • How to update google-maps-react direction route?
  • Download file from an ASP.NET Web API method using AngularJS
  • npm ERR! fetch failed status code 502
  • Webpack dev server for vue-cli: Error spawn EACCES
  • When to use CouchDB over MongoDB and vice versa
  • How to use google maps without api key
  • Running Svelte on Windows 10 - 'sirv' is not…
  • How can I view the source code for a function?
  • Text size and different android screen sizes
  • When to Redis? When to MongoDB?
  • install / uninstall APKs programmatically…
  • Ubuntu: OpenJDK 8 - Unable to locate package
  • MongoDB vs. Cassandra
  • MongoDB and "joins"
  • npm run dev command does not work on vuejs'…
  • share backbone code on client and server side with…
  • How to Display Multiple Google Maps per page with API V3

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

How to interpolate variables in strings in JavaScript, without concatenation?

Next Post:

Add a tooltip to a div

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

.net ajax android angular arrays aurelia backbone.js bash c++ css dataframe ember-data ember.js excel git html ios java javascript jquery json laravel linux list mysql next.js node.js pandas php polymer polymer-1.0 python python-3.x r reactjs regex sql sql-server string svelte typescript vue-component vue.js vuejs2 vuetify.js

  • you shouldn’t need to use z-index
  • No column in target database, but getting “The schema update is terminating because data loss might occur”
  • Angular – expected call-signature: ‘changePassword’ to have a typedeftslint(typedef)
  • trying to implement NativeAdFactory imports deprecated method by default in flutter java project
  • What should I use to get an attribute out of my foreign table in Laravel?
© 2022 Fix Code Error