您的位置:首页 > 产品设计 > UI/UE

vue脚手架安装

2017-12-05 11:52 295 查看
vue依赖nodejs,所以首先下载安装node.js,下载完毕后进行安装。

以window为例使用cnpm 安装

===================install info start=======================

C:\Users\dell>cd D:\softwareinstall\node-v8.9.0-win-x64

C:\Users\dell>d:

D:\softwareinstall\node-v8.9.0-win-x64>npm install -g cnpm --registry=https://registry.npm.taobao.org

D:\softwareinstall\node-v8.9.0-win-x64\cnpm -> D:\softwareinstall\node-v8.9.0-win-x64\node_modules\cnpm\bin\cnpm

+ cnpm@5.1.1

added 693 packages in 189.805s

D:\softwareinstall\node-v8.9.0-win-x64>cnpm -v

cnpm@5.1.1 (D:\softwareinstall\node-v8.9.0-win-x64\node_modules\cnpm\lib\parse_argv.js)

npm@5.5.1 (D:\softwareinstall\node-v8.9.0-win-x64\node_modules\cnpm\node_modules\npm\lib\npm.js)

node@8.9.0 (D:\softwareinstall\node-v8.9.0-win-x64\node.exe)

npminstall@3.2.1 (D:\softwareinstall\node-v8.9.0-win-x64\node_modules\cnpm\node_modules\npminstall\lib\index.js)

prefix=D:\softwareinstall\node-v8.9.0-win-x64

win32 x64 6.1.7601

registry=http://registry.npm.taobao.org

===================install info end=======================

配置npm全局模块存放路径及cache路径

npm config set cache "E:\node-v8.3.0-win-x86\node_cache"

npm config set prefix "E:\node-v8.3.0-win-x86\node_global"

安装vue

参考vue.js网站

安装vue-cli --->cnpm install -g vue-cli dockey ls=dir在windows系统cmd窗口临时使用ls命令

===================install info start=======================

D:\softwareinstall\node-v8.9.0-win-x64>cnpm install -g vue-cli dockey ls=dir

Downloading vue-cli to D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli_tmp

Copying D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli_tmp\_vue-cli@2.9.2@vue-cli to D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli

Installing vue-cli's dependencies to D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli/node_modules

[1/20] commander@^2.9.0 installed at node_modules\_commander@2.12.2@commander

[2/20] consolidate@^0.14.0 installed at node_modules\_consolidate@0.14.5@consolidate

[3/20] async@^2.4.0 installed at node_modules\_async@2.6.0@async

[npminstall:get] retry GET http://registry.npm.taobao.org/minimatch after 100ms, retry left 4, error: ResponseError: socket hang up (req "error"), GET http://registry.npm.taobao.org/minimatch -1 (connected: true, keepalive socket: false, ag

: {"createSocketCount":12,"createSocketErrorCount":0,"closeSocketCount":1,"errorSocketCount":0,"timeoutSocketCount":2,"requestCount":62,"freeSockets":{},"sockets":{"registry.npm.taobao.org:80:":10},"requests":{"registry.npm.taobao.org:80:":

headers: {}

[npminstall:get] retry GET http://registry.npm.taobao.org/inquirer after 100ms, retry left 4, error: ResponseError: socket hang up (req "error"), GET http://registry.npm.taobao.org/inquirer -1 (connected: true, keepalive socket: false, agen

{"createSocketCount":12,"createSocketErrorCount":0,"closeSocketCount":2,"errorSocketCount":0,"timeoutSocketCount":2,"requestCount":62,"freeSockets":{},"sockets":{"registry.npm.taobao.org:80:":10},"requests":{"registry.npm.taobao.org:80:":6}

headers: {}

[4/20] read-metadata@^1.0.0 installed at node_modules\_read-metadata@1.0.0@read-metadata

[5/20] rimraf@^2.5.0 existed at node_modules\_rimraf@2.6.2@rimraf

[6/20] multimatch@^2.1.0 installed at node_modules\_multimatch@2.1.0@multimatch

[7/20] semver@^5.1.0 installed at node_modules\_semver@5.4.1@semver

[8/20] uid@0.0.2 installed at node_modules\_uid@0.0.2@uid

[9/20] chalk@^2.1.0 installed at node_modules\_chalk@2.3.0@chalk

[10/20] ora@^1.3.0 installed at node_modules\_ora@1.3.0@ora

[11/20] coffee-script@1.12.7 existed at node_modules\_coffee-script@1.12.7@coffee-script

[12/20] user-home@^2.0.0 installed at node_modules\_user-home@2.0.0@user-home

[13/20] tildify@^1.2.0 installed at node_modules\_tildify@1.2.0@tildify

[14/20] validate-npm-package-name@^3.0.0 installed at node_modules\_validate-npm-package-name@3.0.0@validate-npm-package-name

[15/20] handlebars@^4.0.5 installed at node_modules\_handlebars@4.0.11@handlebars

[16/20] minimatch@^3.0.0 installed at node_modules\_minimatch@3.0.4@minimatch

[17/20] request@^2.67.0 installed at node_modules\_request@2.83.0@request

[18/20] metalsmith@^2.1.0 installed at node_modules\_metalsmith@2.3.0@metalsmith

[19/20] inquirer@^3.3.0 installed at node_modules\_inquirer@3.3.0@inquirer

[20/20] download-git-repo@^1.0.1 installed at node_modules\_download-git-repo@1.0.1@download-git-repo

deprecate metalsmith@2.3.0 › gray-matter@2.1.1 › coffee-script@^1.12.4 CoffeeScript on NPM has moved to "coffeescript" (no hyphen)

Recently updated (since 2017-11-28): 3 packages (detail see file D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli\node_modules\.recently_updates.txt)

  2017-12-02

    → request@2.83.0 › har-validator@5.0.3 › ajv@^5.1.0(5.5.1) (20:48:13)

  2017-12-01

    → request@2.83.0 › http-signature@1.2.0 › jsprim@1.4.1 › verror@1.10.0 › extsprintf@^1.2.0(1.4.0) (05:26:44)

  2017-11-28

    → commander@^2.9.0(2.12.2) (15:08:54)

All packages installed (253 packages installed from npm registry, used 1m, speed 76kB/s, json 235(392.73kB), tarball 4.46MB)

[vue-cli@2.9.2] link D:\softwareinstall\node-v8.9.0-win-x64\vue@ -> D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli\bin\vue

[vue-cli@2.9.2] link D:\softwareinstall\node-v8.9.0-win-x64\vue-init@ -> D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli\bin\vue-init

[vue-cli@2.9.2] link D:\softwareinstall\node-v8.9.0-win-x64\vue-list@ -> D:\softwareinstall\node-v8.9.0-win-x64\node_modules\vue-cli\bin\vue-list

Downloading dockey to D:\softwareinstall\node-v8.9.0-win-x64\node_modules\dockey_tmp

Error: GET http://registry.npm.taobao.org/dockey response 404 status

    at get (D:\softwareinstall\node-v8.9.0-win-x64\node_modules\cnpm\node_modules\npminstall\lib\get.js:57:17)

    at get.next (<anonymous>)

    at onFulfilled (D:\softwareinstall\node-v8.9.0-win-x64\node_modules\cnpm\node_modules\co\index.js:65:19)

    at <anonymous>

    at process._tickCallback (internal/process/next_tick.js:188:7)

npminstall version: 3.2.1

npminstall args: D:\softwareinstall\node-v8.9.0-win-x64\node.exe D:\softwareinstall\node-v8.9.0-win-x64\node_modules\cnpm\node_modules\npminstall\bin\install.js --china --userconfig=C:\Users\dell\.cnpmrc --disturl=https://npm.taobao.org/mir

--registry=http://registry.npm.taobao.org -g vue-cli dockey ls=dir

===================install info end=======================

4.ls

===================install info start=======================

D:\softwareinstall\node-v8.9.0-win-x64>ls

 驱动器 D 中的卷没有标签。

 卷的序列号是 CC47-3E75

 D:\softwareinstall\node-v8.9.0-win-x64 的目录

2017/12/05  11:30    <DIR>          .

2017/12/05  11:30    <DIR>          ..

2017/10/31  10:50            54,779 CHANGELOG.md

2017/12/05  11:28                 0 cnpm

2017/12/05  11:26               194 cnpm.cmd

2017/12/05  11:23    <DIR>          etc

2017/11/01  00:17            58,983 LICENSE

2017/11/01  00:44        23,087,256 node.exe

2016/12/23  02:01               702 nodevars.bat

2017/10/26  05:37            10,630 node_etw_provider.man

2017/12/05  11:29    <DIR>          node_modules

2016/12/23  02:01             4,974 node_perfctr_provider.man

2016/11/17  03:45               867 npm

2016/11/17  03:45               483 npm.cmd

2017/10/27  03:00               867 npx

2017/10/27  03:00               483 npx.cmd

2017/10/31  11:41            27,115 README.md

2017/12/05  11:30               321 vue

2017/12/05  11:30               331 vue-init

2017/12/05  11:30               208 vue-init.cmd

2017/12/05  11:30               331 vue-list

2017/12/05  11:30               208 vue-list.cmd

2017/12/05  11:30               198 vue.cmd

              19 个文件     23,248,930 字节

               4 个目录 119,470,448,640 可用字节

===================install info end=======================

5.vue

===================install info
start=======================

D:\softwareinstall\node-v8.9.0-win-x64>vue

  Usage: vue <command> [options]

  Options:

    -V, --version  output the version number

    -h, --help     output usage information

  Commands:

    init        generate a new project from a template

    list        list available official templates

    build       prototype a new project

    help [cmd]  display help for [cmd]

===================install info
end=======================

6.创建my-first-vue-project -->vue init webpack my-first-vue-project
===================install info start=======================

===================install info end=======================
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: