Let me explain....
Like.. I want to install jQuery package using npm, and the version of jquery is smaller than 3.0.0.
So how can I do it?
To downgrade an npm package, run the npm install <package>@<version> command. You need to provide the version you want to install with the @<version> syntax.
The npm program that you used to install packages under the node_modules/ folder is actually just a node package. When you need to downgrade npm , you need to run the npm install -g npm@<version> command followed by the version you want to install.
Use npm list [package-name] to know the specific latest version of an installed package. Use npm install [package-name]@[version-number] to install an older version of a package. Prefix a version number with a caret (^) or a tilde (~) to specify to install the latest minor or patch version, respectively.
You can install an npm package below a specific version using this:
npm install jquery@">=0.1.0 <3.0.0" // Using a range
npm install jquery@"<3.0.0" // Below a specific version
You can refer to this link for more information: https://docs.npmjs.com/cli/install
I think you must update the dependency version in "package.json" (which you required) and then run the "npm install" command.It will update the package with which we added in the "package.json" file. Hope this will fix the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With