角度安装 [英] Angular installation

查看:63
本文介绍了角度安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows 7上安装Angular版本4. *.
我目前正在使用Angular 1.6版.*

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

我尝试了以下命令

npm install @angular/{common,compiler,compiler-cli,core,forms,http,platform-browser,platform-browser-dynamic,platform-server,router,animations}@next --save

但是它不起作用

任何人都可以指导我安装和创建angular 4项目.

Can any one please guide me to install and to create angular 4 project..

推荐答案

  1. 确保节点版本高于6.9,npm高于3
  2. 通过使用节点--version和npm --version检查版本
  3. 使用npm install -g @ angular/cli安装angular cli
  4. -g在系统上全局安装角度,您只需要运行一次此命令
  5. 使用"ng new angularprojectname"创建角度项目
  6. 转到该项目文件夹并通过"ng -v"检查角度版本
  7. 通过运行以下命令将此版本升级到angular 4-

  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-

对于Windows- npm install @ angular/common @ next @ angular/compiler @ next @ angular/compiler-cli @ next @ angular/core @ next @ angular/forms @ next @ angular/http @ next @ angular/platform-b​​rowser @ next @angular/platform-b​​rowser-dynamic @ next @ angular/platform-server @ next @ angular/router @ next @ angular/animations @ next --save

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

对于Linux/Mac- npm install @ angular/{common,compiler,compiler-cli,core,forms,http,platform-b​​rowser,platform-b​​rowser-dynamic,platform-server,router,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

请确保通过运行以下命令来升级打字稿版本: npm install typescript@2.2.1 --save

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

忽略出现的任何警告,然后通过"ng -v"检查角度版本 版本已从2.2.4更改为4.1.0

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

您还可以在package.json文件中查看有关角度cli的所有信息.

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

这篇关于角度安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆