Angular CLI: 1.6.7 入门

当你使用npm或者yarn也安装不了angular-cli时,请使用淘宝镜像。

Step1

npm i -g cnpm --registry=https://registry.npm.taobao.org

Step2

cnpm i -g @angular/cli
C:\Users\Administrator\Desktop>cnpm i -g @angular/cli
Downloading @angular/cli to I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli_tmp
Copying I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli_tmp\[email protected][email protected]1.6.7@@angular\cli to I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli
Installing @angular/cli‘s dependencies to I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli/node_modules
[1/57] [email protected]^4.2.1 installed at node_modules\[email protected]4.4.0@circular-dependency-plugin
[2/57] @ngtools/[email protected]1.1.0 installed at node_modules\[email protected][email protected]1.1.0@@ngtools\json-schema
[3/57] core-object@^3.1.0 installed at node_modules\_core-object@3.1.5@core-object
[4/57] [email protected]~2.2.0 installed at node_modules\[email protected]2.2.2@chalk
[5/57] [email protected]^0.28.1 installed at node_modules\[email protected]0.28.9@css-loader
[6/57] [email protected]^1.2.1 installed at node_modules\[email protected]1.2.1@denodeify
[7/57] ember-cli-string[email protected]^1.0.0 installed at node_modules\_ember-cli-string[email protected]1.1.0@ember-cli-string-utils
[8/57] [email protected]^0.6.3 installed at node_modules\[email protected]0.6.4@exports-loader
[9/57] [email protected]^7.2.3 installed at node_modules\[email protected]7.2.5@autoprefixer
[10/57] [email protected]^4.1.1 installed at node_modules\[email protected]4.3.1@copy-webpack-plugin
[11/57] [email protected]^1.1.5 installed at node_modules\[email protected]1.1.6@file-loader
[12/57] [email protected]^7.0.3 existed at node_modules\[email protected]7.1.2@glob
[13/57] [email protected]^3.0.2 installed at node_modules\[email protected]3.0.2@extract-text-webpack-plugin
[14/57] [email protected]^1.2.0 installed at node_modules\[email protected]1.2.0@karma-source-map-support
[15/57] [email protected]^4.0.0 installed at node_modules\[email protected]4.0.3@fs-extra
[16/57] [email protected]^2.29.0 installed at node_modules\[email protected]2.30.1@html-webpack-plugin
[17/57] [email protected]^1.0.0 installed at node_modules\[email protected]1.1.1@license-webpack-plugin
[18/57] [email protected]^4.11.1 existed at node_modules\[email protected]4.17.4@lodash
[19/57] [email protected]1.1.0 existed at node_modules\[email protected]1.1.0@loader-utils
[20/57] [email protected]^0.4.1 existed at node_modules\[email protected]0.4.1@memory-fs
[21/57] [email protected]^3.0.4 existed at node_modules\[email protected]3.0.4@minimatch
[22/57] [email protected]^1.0.0 installed at node_modules\[email protected]1.0.1@node-modules-path
[23/57] [email protected]^1.3.1 installed at node_modules\[email protected]1.7.2@common-tags
[24/57] [email protected]^4.0.1 installed at node_modules\[email protected]4.0.1@nopt
[25/57] @ngtools/[email protected]1.9.7 installed at node_modules\[email protected][email protected]1.9.7@@ngtools\webpack
[26/57] [email protected]^3.10.0 installed at node_modules\[email protected]3.10.0@cssnano
[27/57] [email protected]~5.1.0 installed at node_modules\[email protected]5.1.0@opn
[28/57] [email protected]~1.0.12 installed at node_modules\[email protected]1.0.13@portfinder
[29/57] [email protected]^0.5.1 installed at node_modules\[email protected]0.5.1@raw-loader
[30/57] [email protected]^1.1.7 existed at node_modules\[email protected]1.5.0@resolve
[31/57] [email protected]^11.0.0 installed at node_modules\[email protected]11.0.0@postcss-import
[32/57] [email protected]^7.1.2 installed at node_modules\[email protected]7.3.0@postcss-url
[33/57] [email protected]^5.1.0 existed at node_modules\[email protected]5.5.0@semver
[34/57] [email protected]^4.0.5 installed at node_modules\[email protected]4.0.5@less-loader
[35/57] [email protected]^0.4.1 existed at node_modules\[email protected]0.4.18@source-map-support
[36/57] [email protected]^1.0.0 installed at node_modules\[email protected]1.1.0@silent-error
[37/57] [email protected]^0.13.1 installed at node_modules\[email protected]0.13.2@style-loader
[38/57] [email protected]^2.0.10 installed at node_modules\[email protected]2.1.0@postcss-loader
[39/57] [email protected]^3.0.1 installed at node_modules\[email protected]3.0.1@stylus-loader
[40/57] [email protected]^3.0.0 installed at node_modules\[email protected]3.0.0@istanbul-instrumenter-loader
[41/57] [email protected]^0.6.2 installed at node_modules\[email protected]0.6.2@url-loader
[42/57] [email protected]~3.10.0 existed at node_modules\[email protected]3.10.0@webpack
[email protected]1.1.3 download from binary mirror: {"module_name":"fse","module_path":"./lib/binding/{configuration}/{node_abi}-{platform}-{arch}/","remote_path":"./v{version}/","package_name":"{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz","host":"https://npm.taobao.org/mirrors/fsevents"}
platform unsupported @angular-devkit/[email protected]0.0.29 › [email protected]1.7.0 › [email protected]^1.0.0 Package require os(darwin) not compatible with your platform(win32)
[[email protected]^1.0.0] optional install error: Package require os(darwin) not compatible with your platform(win32)
[43/57] [email protected]^0.54.5 installed at node_modules\[email protected]0.54.5@stylus
[44/57] [email protected]~1.12.0 installed at node_modules\[email protected]1.12.2@webpack-dev-middleware
[45/57] [email protected]^1.1.5 installed at node_modules\[email protected]1.1.8@uglifyjs-webpack-plugin
[46/57] [email protected]^1.0.0 existed at node_modules\[email protected]1.1.0@webpack-sources
[47/57] [email protected]^4.1.0 installed at node_modules\[email protected]4.1.1@webpack-merge
[48/57] [email protected]^2.7.2 installed at node_modules\[email protected]2.7.3@less
[49/57] [email protected]^1.0.1 installed at node_modules\[email protected]1.0.3@webpack-subresource-integrity
[50/57] [email protected]^4.7.2 existed at node_modules\[email protected]4.7.2@node-sass
[51/57] @schematics/[email protected]0.1.17 installed at node_modules\[email protected][email protected]0.1.17@@schematics\angular
[52/57] @angular-devkit/[email protected]0.0.42 installed at node_modules\[email protected][email protected]0.0.42@@angular-devkit\build-optimizer
[53/57] [email protected]~2.11.0 installed at node_modules\[email protected]2.11.1@webpack-dev-server
[54/57] [email protected]^5.5.6 existed at node_modules\[email protected]5.5.6@rxjs
[55/57] @angular-devkit/[email protected]0.0.52 installed at node_modules\[email protected][email protected]0.0.52@@angular-devkit\schematics
[56/57] [email protected]^6.0.6 installed at node_modules\[email protected]6.0.6@sass-loader
[57/57] @angular-devkit/[email protected]0.0.29 installed at node_modules\[email protected][email protected]0.0.29@@angular-devkit\core
execute post install 2 scripts...
[1/2] scripts.postinstall @ngtools/[email protected]1.9.7 › [email protected]3.10.0 › [email protected]^0.4.6 run "node lib/post_install.js"
[1/2] scripts.postinstall @ngtools/[email protected]1.9.7 › [email protected]3.10.0 › [email protected]^0.4.6 finished in 360ms
[2/2] scripts.install [email protected]6.0.6 › [email protected]^4.7.2 run "node scripts/install.js"
Downloading binary from https://npm.taobao.org/mirrors/node-sass/v4.7.2/win32-x64-57_binding.node
Download complete
Binary saved to I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli\node_modules\[email protected]4.7.2@node-sass\vendor\win32-x64-57\binding.node
Caching binary to C:\Users\Administrator\.npminstall_tarball\node-sass\4.7.2\win32-x64-57_binding.node
[2/2] scripts.install [email protected]6.0.6 › [email protected]^4.7.2 finished in 1s
[2/2] scripts.postinstall [email protected]6.0.6 › [email protected]^4.7.2 run "node scripts/build.js"
Binary found at I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli\node_modules\[email protected]4.7.2@node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
[2/2] scripts.postinstall [email protected]6.0.6 › [email protected]^4.7.2 finished in 2s
Recently updated (since 2018-01-26): 13 packages (detail see file I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli\node_modules\.recently_updates.txt)
  Today:
    → [email protected]7.2.5 › [email protected]^6.0.16(6.0.17) (03:56:55)
    → @ngtools/[email protected]1.9.7 › [email protected]3.10.0 › [email protected]^5.0.0(5.4.1) (17:19:21)
    → @ngtools/[email protected]1.9.7 › [email protected]3.10.0 › [email protected]8.0.2 › [email protected]2.1.0 › [email protected]1.1.0 › [email protected]^1.0.0(1.2.0) (11:28:18)
    → postcss[email protected]^2.0.10(2.1.0) (10:49:53)
  2018-02-01
    → @ngtools/[email protected]1.9.7(1.9.7) (05:22:12)
    → [email protected]7.2.5 › [email protected]2.11.3 › [email protected]^1.3.30(1.3.32) (09:02:19)
  2018-01-31
    → [email protected]3.10.0 › [email protected]6.7.7 › [email protected]^1.0.30000634(1.0.30000800) (12:37:33)
  2018-01-30
    → uglifyjs[email protected]^1.1.5(1.1.8) (04:45:55)
  2018-01-29
    → webpack[email protected]2.11.1 › [email protected]^1.9.1(1.10.2) (20:49:12)
  2018-01-28
    → uglifyjs[email protected]1.1.8 › [email protected]^3.3.4(3.3.9) (00:54:24)
  2018-01-27
    → css[email protected]0.28.9 › [email protected]5.2.18 › [email protected]^2.1.9(2.4.3) (15:43:43)
    → html[email protected]2.30.1 › [email protected]3.5.8 › [email protected]3.3.x(3.3.9) (22:58:27)
    → webpack[email protected]2.11.1 › [email protected]3.5.0 › [email protected]^6.0.1(6.2.3) (18:17:19)
All packages installed (893 packages installed from npm registry, used 1m, speed 336.62kB/s, json 760(1.41MB), tarball 23.83MB)
[@angular/[email protected]1.6.7] link I:\Node\node-v8.9.4-win-x64\[email protected] -> I:\Node\node-v8.9.4-win-x64\node_modules\@angular\cli\bin\ng

step3

ng new test-app

step4

cd test-app
ng serve --open

最后,只要学习一下相对应的ng-cli参数即可。

原文地址:https://www.cnblogs.com/cisum/p/8406469.html

时间: 2024-07-30 00:14:52

Angular CLI: 1.6.7 入门的相关文章

.Net Core + Angular Cli 开发环境搭建

一.基础环境配置 1.安装VS 2017 v15.3或以上版本 2.安装VS Code最新版本 3.安装Node.js v6.9以上版本 4.重置全局npm源,修正为 淘宝的 NPM 镜像: npm install -g cnpm --registry=https://registry.npm.taobao.org 5.安装TypeScript cnpm install -g typescript typings 6.安装 AngularJS CLI cnpm install -g @angul

.Net Core+Angular Cli/Angular4开发环境搭建教程

一.基础环境配置1.安装VS2017v15.3或以上版本2.安装VSCode最新版本3.安装Node.jsv6.9以上版本4.重置全局npm源,修正为淘宝的NPM镜像:npminstall-gcnpm 一.基础环境配置 1.安装VS 2017 v15.3或以上版本2.安装VS Code最新版本3.安装Node.js v6.9以上版本4.重置全局npm源,修正为 淘宝的 NPM 镜像: npm install -g cnpm --registry=https://registry.npm.taob

使用Angular CLI创建Angular 2项目

一.安装nvm-windows,方便node版本切换 nvm list //查看已安装的版本 nvm install 6.11.0 //安装Node.js 6.11.0,因为@angular/cli需要6.9版本以上支持 nvm use 6.11.0 //切换到新安装的版本 二.为npm配置proxy(proxy软件需自行安装) npm config set proxy=http://localhost:1080 npm config set https-proxy=http://localho

angular cli

1. 安装cnpm: npm install -g cnpm --registry=https://registry.npm.taobao.org 2. 安装angular/cli: cnpm install -g @angular/cli 3. 创建一个示例程序 ng new my-app --skip-install cd my-app cnpm install ng serve

Angular CLI 安装

安装Angular 官网的教程,因为国内网络环境原因,访问不了服务器,导致安装失败. 1.先安装NodeJs 安装教程:http://blog.csdn.net/zengmingen/article/details/72650484 2.通过NodeJs中的模块npm 命令行安装 CLI 2.1.设置npm的资源库为国内淘宝的. 命令: [plain] view plain copy npm config set registry https://registry.npm.taobao.org

angular CLI 快速搭建angular 项目

1. 首先确保你的电脑上安装了Node.js®和npm 2.打开终端/或命令窗,安装全局 angular CLI npm install -g @angular/cli 3. 创建新项目 //运行下列命令来生成一个新项目以及应用的骨架代码: ng new project-name // 请耐心等待. 创建新项目需要花费很多时间,大多数时候都是在安装那些npm包. 4. 启动开发服务器 // 进入项目目录 cd my-app //启动服务 ng serve --open 5. 文件结构如下 src

Angular/cli 安装(windows环境)。

1.卸载先前安装的Angular/cli npm uninstall -g angular-clinpm uninstall --save-dev angular-clinpm uninstall -g @angular/cli 2..删除 C:\Users\lenovo\AppData\Roaming 下的npm 和 npm cache文件夹. 3.卸载node.js 下载安装最新版本, 安装路径默认即可. 4. node -v npm -v 查看版本 5.用npm安装typescript和t

Angular环境准备和Angular cli

Angular4.0来了,更小,更快,改动少 接下来为Angular4.0准备环境和学会使用Angular cli项目 1.环境准备: 1)在开始工作之前我们必须设置好开发环境 如果你的机器上还没有安装Node.js和npm,请安装他们 (这里特别推荐使用淘宝的镜像cnpm,记得以后把npm的指令改为cnpm就可以了) npm install -g cnpm --registry=https://registry.npm.taobao.org 然后我们可以通过node -v和cnpm -v来分别

angular学习笔记---通过angular/cli建一个新的项目

理一下基于angular/cli建立新项目的思路: (1)安装nodejs (2)安装git (3)安装淘宝镜像cnpm (4)安装@angular/cli,在管理员模式下运行:cnpm install -g @angular/cli (5)测试@angular/cl是否安装成功,运行:ng (6)选择一个目标文件夹,进入该文件夹,如首先进入e盘:e:     ,其次进入e盘下的test文件夹:cd test   ,再在该文件夹下建立一个项目:ng new project 此时,项目建好之后会自