Angular installation

前端 未结 9 954
傲寒
傲寒 2021-02-06 13:55

I want to install Angular version 4.* on my windows 7.
I am currently using Angular version 1.6.*

I tried following command

npm install @angular/{com         


        
9条回答
  •  悲哀的现实
    2021-02-06 14:30

    1. Make sure you have node version above 6.9 and npm above 3
    2. Check the version by using node --version and npm --version
    3. Install angular cli using npm install -g @angular/cli
    4. -g installs the angular globally on your system and you just have to run this command only once
    5. Create the angular project using ‘ng new angularprojectname’
    6. Go to that project folder and check the angular version by ‘ng -v’
    7. 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

    Make sure to upgrade the typescript version by running command- npm install typescript@2.2.1 --save

    Ignore whatever warning it shows up and now check the angular version by ‘ng -v’ The version has changed from 2.2.4 to 4.1.0

    You can also check all the info about your angular cli in package.json file.

提交回复
热议问题