Corner installation
I want to install Angular version 4. * on my windows 7.
I am currently using Angular version 1.6. *
I have tried the following command
npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save
But its not working
Can anyone help me install and build my Angular 4 project.
source to share
- Make sure node version is higher than 6.9 and npm is higher than 3
- Check the version with node --version and npm -version
- Install angular cli using npm install -g @ angular / cli
- -g installs the angular global system on your system and you just need to run this command only once
- Create angular project using 'ng new angularprojectname
- Go to this project folder and check the angular version for 'ng -v
-
Upgrade this version to angular 4 by running this command -
For Windows- npm install @ angular / common @next @ angular / compiler @next @ angular / compiler-cli @next @ angular / core @next @ angular / forms @next @ angular / http @next @ angular / platform-browser @ next @ angular / platform-browser-dynamic @next @ angular / platform-server @next @ angular / router @next @ angular / animations @next --save
For Linux / Mac- npm install @ angular / {common, compiler, compiler-cli, core, forms, http, platform-browser, platform-browser-dynamic, platform-server, router, animations} @next --save
Be sure to update your typescript version by running the command - npm install typescript @ 2.2.1 --save
Ignore all warnings it shows and now check angular version to 'ng -v Version changed from 2.2.4 to 4.1.0
You can also check all information about your angular cli in package.json file.
source to share
You can reference this to follow all Angular 4 steps
https://www.youtube.com/watch?v=yAJ05021nro
Steps below:
-
Install Node.js and npm: https://nodejs.org/en/download/
-
Then install Angular CLI globally.
npm install -g @ angular / cli
-
You can check the version:
node -v
npm -v
-
Open a terminal window in that folder (shif + right click for the window). ng new my-app
-
Go to your project directory and start the server.
cd my-app (go to folder project)
ng serve --open
source to share
There are many ways to structure AngularJS applications. When you start upgrading these apps to Angular, some of them will be much easier to work with than others. There are several key techniques and patterns that you can apply to future applications before migrating.
- Follow AngularJS Style Guide
- Using the module loader
- Switching to TypeScript
-
Using component directives
Or can follow the official Angular doc
source to share
Follow these simple steps to install Angular 4:
- Install node.js and npm (required dependencies. Npm is automatically installed when you install node.js). You can install it from here
- Install Angular CLI using npm. Enter the following command at the command line: npm install -g @ angular / cli
- If you are still facing some problems, you need to install git. You can install it from here
- Now, to create an Angular 4 project using Angular CLI, enter the following command: ng new [Project_Name] This will create an Angualr 4 project. 5. To start the server and get your project up and down, type in the command line: ng serve
Remember that you must be inside the project folder before starting the server. Hope this helps.
source to share
Install angular cli globally.
npm install -g @angular/cli
Get git pull from repository: -
[ https://github.com/blazehub/ng-cli-starter.git]
to prepare a finished project of a finished project structure.
source to share
I am adding this to update the answer.
If you want to install the latest angular version, the other answers are for you.
If you want to install a specific version of angular ( enter your version number here ) you must use the below command.
npm install -g @angular/cli@VERSION_NUMBER
for example if you want to install angular command 1.4.9 should be like below
npm install -g @angular/cli@1.4.9
source to share