Mistakenly installed angular prelease version.
Now unable to uninstall the prelease version and install stable version.
Its seems like you have installed angular 12 on specific project.
If you want to install the specific version of angular globally, you need to uninstall current version of angular (if you have already installed), then you can install angular version as per required.
To uninstall the current version of angular cli: npm uninstall -g angular-cli
To install specific version of angular globally: npm install -g angular-cli#ANGULAR_VERSION
Here ANGULAR_VERSION means angular version that you are going to install. Please replace ANGULAR_VERSION with angular version (e.g. 10/11/12/13).
In your case if you want to install angular 13 globally then you can use: npm install -g angular-cli#13
Related
Does npm install <package_name> install the latest version of a package or the latest compatible with the version of node installed?
What will happen in these 2 cases?
Case 1:
Node version in the directory is 10.16.0.
Will 'npm install xyz' install the latest xyz or the latest compatible version with 10.16.0?
Case 2:
Node version in the directory is 10.16.0
Will 'npm install -g xyz' install the latest xyz or the latest compatible with the version of node installed globally OR will it consider 10.16.0?
Answer
Latest Version
HOWEVER
If the package is already installed in a project or contained within the package.json file, then the version string Is what NPM will try and use, Which may contain a Caret(^) which tells npm Not to update the Major Version.
For more info read below
Npm install will always install the latest Full Release build of the package (Skips -tag.x versions) unless manually specified, which can potentially be incompatible with some versions of node. Not all packages specify the engine it is compatible with so sometimes you have to do some digging or trial and error.
You can Manually select a version by adding # to the package.
For instance, npm install xyz#10.16.0 will install that specific package version. You can also prefix a version number with a caret (^) to install the latest Minor build, or a tilde (~) to specify the latest patch version.
For example
xyz#^1.2.0 could install say 1.8.0, and xyz#~1.2.0 could install 1.2.9, but Never 1.3.0
For more info on versioning strings read up on Semantic Versioning aka SemVer
https://github.com/npm/node-semver#versions
At work we had problem that wasn't displaying icon (from rc-menu lib) for menu block
Each time when we are running
mvn install
we are also running
npm install
inside package json we had this library
"rc-menu":"^5.10.0"
The way to fix it was to run
npm install rc-menu (Inside package.json directory)
My question why this solution works?
For me it is impossible but maybe I'm missing something?
Your version must be a missmatch.
With npm install {package_name} you are installing the latest version. And with npm install you are installing version that satisfies rules of your package.json.
As far as I can see that module doesn't have 5.10.0 version at all...
5.0.14 is the latest of 105 releases
You can try to see the version of that module if you install it with npm install by typing npm list afterwards.
It seems if I use npm install --save <package_name>, it installs the latest stable version.
I want to install the absolutely latest release. So if I, for instance, want to install Bootstrap v4, I need to do npm install bootstrap#4.0.0-alpha.6 instead of just npm install bootstrap.
But if I didn't know that the latest version is named 4.0.0-alpha.6, I wouldn't be able to install it. Is there a flag or something else I can use to make sure I get the latest version?
You need to use the #next keyword to get the latest alpha/beta releases of a package.
In your case, it will be,
npm install bootstrap#next --save
Hope this helps!
Try:
npm install bootstrap#next
This way you can install alpha/beta releases.
I have a workspace on c9.io, and I am using node.js. I am trying to update socket.io from 0.9.17 to the latest version. However, whenever I run the command npm update socket.io it installs the same version. How can I fix this?
To install the latest available package:
npm install <package>
To install a version directly (no need to uninstall first):
npm install <package>#<version>
If you're not sure what versions of a package are available, you can use:
npm view <package> versions
Don't forget the --save flag to add dependencies to your package.json file.
Source: How do I install a previous version of an npm package?
About npm update
However, if app's package.json contains:
"dependencies": {
"dep1": "~1.1.1"
}
In this case, running npm update will install dep1#1.1.2. Even though the latest tag points to 1.2.2, this version does not satisfy ~1.1.1, which is equivalent to >=1.1.1 <1.2.0. So the highest-sorting version that satisfies ~1.1.1 is used, which is 1.1.2.
Source: npm update - Tilde Dependencies
How can I update my Sails.js framework (installed on OSX) to newest version using terminal/command line?
To update to the latest stable version:
npm update sails
or, if you've installed it globally, it would be:
sudo npm update -g sails
to install globally. This will overwrite any existing install.
npm update [-g] [<name> [<name> ...]]
This command will update all the packages listed to the latest version (specified by the tag config). It will also install missing packages.
If the -g flag is specified, this command will update globally installed packages.
So for you, I guess that would be: npm update sails or sudo npm -g update sails depending on how and where you installed it.