角度安装 [英] Angular installation
问题描述
我想在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..
推荐答案
- 确保节点版本高于6.9,npm高于3
- 通过使用节点--version和npm --version检查版本
- 使用npm install -g @ angular/cli安装angular cli
- -g在系统上全局安装角度,您只需要运行一次此命令
- 使用"ng new angularprojectname"创建角度项目
- 转到该项目文件夹并通过"ng -v"检查角度版本
-
通过运行以下命令将此版本升级到angular 4-
- Make sure you have node version above 6.9 and npm above 3
- Check the version by using node --version and npm --version
- Install angular cli using npm install -g @angular/cli
- -g installs the angular globally on your system and you just have to run this command only once
- Create the angular project using ‘ng new angularprojectname’
- Go to that project folder and check the angular version by ‘ng -v’
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-browser @ next @angular/platform-browser-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-browser,platform-browser-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屋!