For installation of Angular CLI on windows you can use the same command by just removing the sudo. Create the first Angular App. For creating the Angular app to test your installation use the below command from a terminal. We can use the same command in Linux as well as Windows.
I searched through google and angular cli doc but couldn't find any way to install a specific version of angular using angular cli. is it even possible?
SajadSajad7 Answers
You can just have package.json with specific version and do npm install
and it will install that version.Also you dont need to depend on angular-cli
to develop your project.
To answer your question, let's assume that you are interested in a specific angular version and NOT in a specific angular-cli version (angular-cli is just a tool after all).
A reasonnable move is to keep your angular-cli version alligned with your angular version, otherwise you risk to stumble into incompatibilities issues. So getting the correct angular-cli version will lead you to getting the desired angular version.
From that assumption, your question is not about angular-cli, but about npm.
Here is the way to go:
![Install angular cli permission denied Install angular cli permission denied](http://programmertunnel.com/wp-content/uploads/2018/02/angular@cli-1024x672.jpg)
[STEP 0 - OPTIONAL] If you're not sure of the angular-cli version installed in your environment, uninstall it.
Then, run (--force flag might be required)
or, if you're using npm > 5.
[STEP 1] Install an angular-cli specific version
[STEP 2] Create a project
The resulting white app will be created in the desired angular version.
NOTE: I have not found any page displaying the compatibility matrix of angular and angular-cli. So I guess the only way to know what angular-cli version should be installed is to try various versions, create a new project and checkout the package.json
to see which angular version is used.
angular versions changelogHere is the changelog from github reposition, where you can check available versions and the differences.
Hope it helps
avi.elkharratavi.elkharratEdit #2 ( 7/2/2017)
If you install the angular cli right now, you'd probably have the new name of angular cli which is @angular/cli
, so you need to uninstall it using
and follow the code above. I'm still getting upvotes for this so I updated my answer for those who want to use the older version for some reasons.
Edit #1
If you really want to create a new project with previous version of Angular using the cli, try to downgrade the angular-cli before the final release. Something like:
Initial
You can change the version of the angular in the package.json . I'm guessing you want to use older version of angular but I suggest you use the latest version. Using:
will always use the latest version of angular.
brijmcqbrijmcqSpecify the version you want in the 'dependencies' section of your package.json, then from your root project folder in the console/terminal run this:
For example, the following will specifically install v4.3.4
You can also add the following modifiers to the version number to vary how specific you need the version to be:
caret ^
Updates you to the most recent major version, as specified by the first number:
will load the latest 4.x.x release, but will not load 5.x.x
tilde ~
Update you to the most recent minor version, as specified by the second number:
will load the latest 4.3.x release, but will not load 4.4.x
Chris HalcrowChris Halcrowuse the following command to install the specific version. say you want to install angular/cli version 1.6.8 then enter the following command :
this will install angular/cli version 1.6.8
The angular/cli
versions and their installed angular/compiler
versions:
- 1.0 - 1.4.x = ^4.0.0
- 1.5.x = ^5.0.0
- 1.6.x - 1.7.x = ^5.2.0
- 6.x = ^6.0.0
- 7.x = ^7.0.0
Can be confirmed by reviewing the angular/cli
's package.json
file in the repository. One would have to install the specific cli version to get the specific angular version:
You can create angular4 project using angular-cli command. This is working with angular cli version '1.0.0-rc.1'
DimuthuDimuthuNot the answer you're looking for? Browse other questions tagged angularangular-cli or ask your own question.
I had installation issues of angular-cli on Windows 10 system. The errors were related to Python dependencies and node-gyp. Something as below :
Bhargav Rao♦7 Answers
ahmadali shafieeUpdate
this seems to be fixed in newer releases and this solution is no longer required.
since mukesh51 is not answering his own question and Bhargav Rao removed mukesh51's answer from the question itself, I'm putting the answer here:
the installation seems to work in these steps:
npm install -g node-gyp
npm install -g windows-build-tools
npm install -g @angular/cli
I took these steps from here.
ahmadali shafieeahmadali shafieeUse windows power shell to install angular-cli. It will run without any issues.
Windows 10 Solution
Look back at the trace of installation steps ... you may see that it found the Angular binary in the following location:
C:Program FilesGitusrlocalnode_modules@angularclibin
I added an ENVT variable using this path and ng worked fine after that
I too faced the same issue initially when I installed angular directly using bash. The installation was error completely. Then I attempted to install locally in my project (without removing the global one). That appeared to have solved the problem but got an error on creating a new app.
So i uninstalled everything :
and the reinstalled Angular using Windows Power Shell(as Admin)
This solved the entire problem! Hope it helps!
I tried using npm install -g @angular/cli
npm downloaded files successfully and copied files to AppData but not able to use ng -v
After that, I tried following:
npm cache clean --force
Removes npm cache forcefully if you get warning using npm cache clean
.
![Install Install](https://i.stack.imgur.com/IZYKl.png)
Then try
npm install -g @angular/cli@latest
I have successfully installed by trying the above solution in Windows10.
DanielBoth the CLI and generated project have dependencies that require Node 8.9 or higher, together with NPM 5.5.1 or higher.
try update node.js and npm