vue-cli脚手架的安装

摘要:
命令行安装环境依赖:必须安装node验证node是否安装node-vnpm-v对应显示版本号即可,如下图:全局安装vue-clinpminstall--globalvue-cli如安装过程中安装较慢或较慢,使用手机4G热点安装,亲测好用。

命令行安装

环境依赖:

  • 必须安装node
  • 验证node是否安装
node -v
npm -v 

对应显示版本号即可,如下图:

vue-cli脚手架的安装第1张

全局安装vue-cli

npm install --global vue-cli

如安装过程中安装较慢或较慢,使用手机4G热点安装,亲测好用。

安装成功如下:

C:UsersAdministrator>npm install --global vue-cli
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour
 @vue/cli
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "c
eescript" (no hyphen)
C:UsersAdministratorAppDataRoaming
pmvue -> C:UsersAdministratorAppD
Roaming
pm
ode_modulesvue-cliinvue
C:UsersAdministratorAppDataRoaming
pmvue-list -> C:UsersAdministrator
pDataRoaming
pm
ode_modulesvue-cliinvue-list
C:UsersAdministratorAppDataRoaming
pmvue-init -> C:UsersAdministrator
pDataRoaming
pm
ode_modulesvue-cliinvue-init
C:UsersAdministratorAppDataRoamingnpm
`-- vue-cli@2.9.6
  +-- async@2.6.3
  | `-- lodash@4.17.15
  +-- chalk@2.4.2
  | +-- ansi-styles@3.2.1
  | | `-- color-convert@1.9.3
  | |   `-- color-name@1.1.3
  | +-- escape-string-regexp@1.0.5
  | `-- supports-color@5.5.0
  |   `-- has-flag@3.0.0
  +-- coffee-script@1.12.7
  +-- commander@2.20.3
  +-- consolidate@0.14.5
  | `-- bluebird@3.7.2
  +-- download-git-repo@1.1.0
  | +-- download@5.0.3
  | | +-- caw@2.0.1
  | | | +-- get-proxy@2.1.0
  | | | | `-- npm-conf@1.1.3
  | | | |   +-- config-chain@1.1.12
  | | | |   | +-- ini@1.3.5
  | | | |   | `-- proto-list@1.2.4
  | | | |   `-- pify@3.0.0
  | | | +-- isurl@1.0.0
  | | | | +-- has-to-string-tag-x@1.4.1
  | | | | | `-- has-symbol-support-x@1.4.2
  | | | | `-- is-object@1.0.1
  | | | `-- url-to-options@1.0.1
  | | +-- decompress@4.2.0
  | | | +-- decompress-tar@4.1.1
  | | | | +-- file-type@5.2.0
  | | | | `-- tar-stream@1.6.2
  | | | |   +-- bl@1.2.2
  | | | |   +-- buffer-alloc@1.2.0
  | | | |   | +-- buffer-alloc-unsafe@1.1.0
  | | | |   | `-- buffer-fill@1.0.0
  | | | |   +-- end-of-stream@1.4.4
  | | | |   +-- fs-constants@1.0.0
  | | | |   +-- readable-stream@2.3.6
  | | | |   | +-- isarray@1.0.0
  | | | |   | +-- process-nextick-args@2.0.1
  | | | |   | +-- safe-buffer@5.1.2
  | | | |   | +-- string_decoder@1.1.1
  | | | |   | | `-- safe-buffer@5.1.2
  | | | |   | `-- util-deprecate@1.0.2
  | | | |   +-- to-buffer@1.1.1
  | | | |   `-- xtend@4.0.2
  | | | +-- decompress-tarbz2@4.1.1
  | | | | +-- file-type@6.2.0
  | | | | +-- seek-bzip@1.0.5
  | | | | | `-- commander@2.8.1
  | | | | |   `-- graceful-readlink@1.0.1
  | | | | `-- unbzip2-stream@1.3.3
  | | | |   `-- buffer@5.4.3
  | | | |     +-- base64-js@1.3.1
  | | | |     `-- ieee754@1.1.13
  | | | +-- decompress-targz@4.1.1
  | | | +-- decompress-unzip@4.0.1
  | | | | +-- file-type@3.9.0
  | | | | +-- get-stream@2.3.1
  | | | | | +-- object-assign@4.1.1
  | | | | | `-- pinkie-promise@2.0.1
  | | | | |   `-- pinkie@2.0.4
  | | | | `-- yauzl@2.10.0
  | | | |   +-- buffer-crc32@0.2.13
  | | | |   `-- fd-slicer@1.1.0
  | | | |     `-- pend@1.2.0
  | | | +-- graceful-fs@4.2.3
  | | | +-- make-dir@1.3.0
  | | | | `-- pify@3.0.0
  | | | `-- strip-dirs@2.1.0
  | | |   `-- is-natural-number@4.0.1
  | | +-- filenamify@2.1.0
  | | | +-- filename-reserved-regex@2.0.0
  | | | +-- strip-outer@1.0.1
  | | | `-- trim-repeated@1.0.0
  | | +-- get-stream@3.0.0
  | | +-- got@6.7.1
  | | | +-- create-error-class@3.0.2
  | | | | `-- capture-stack-trace@1.0.1
  | | | +-- duplexer3@0.1.4
  | | | +-- is-redirect@1.0.0
  | | | +-- is-retry-allowed@1.2.0
  | | | +-- is-stream@1.1.0
  | | | +-- lowercase-keys@1.0.1
  | | | +-- timed-out@4.0.1
  | | | +-- unzip-response@2.0.1
  | | | `-- url-parse-lax@1.0.0
  | | |   `-- prepend-http@1.0.4
  | | +-- mkdirp@0.5.1
  | | `-- pify@2.3.0
  | `-- git-clone@0.1.0
  +-- handlebars@4.5.3
  | +-- neo-async@2.6.1
  | +-- optimist@0.6.1
  | | +-- minimist@0.0.8
  | | `-- wordwrap@0.0.3
  | +-- source-map@0.6.1
  | `-- uglify-js@3.7.2
  +-- inquirer@6.5.2
  | +-- ansi-escapes@3.2.0
  | +-- cli-cursor@2.1.0
  | | `-- restore-cursor@2.0.0
  | |   +-- onetime@2.0.1
  | |   | `-- mimic-fn@1.2.0
  | |   `-- signal-exit@3.0.2
  | +-- cli-width@2.2.0
  | +-- external-editor@3.1.0
  | | +-- chardet@0.7.0
  | | +-- iconv-lite@0.4.24
  | | | `-- safer-buffer@2.1.2
  | | `-- tmp@0.0.33
  | |   `-- os-tmpdir@1.0.2
  | +-- figures@2.0.0
  | +-- mute-stream@0.0.7
  | +-- run-async@2.3.0
  | | `-- is-promise@2.1.0
  | +-- rxjs@6.5.3
  | | `-- tslib@1.10.0
  | +-- string-width@2.1.1
  | | +-- is-fullwidth-code-point@2.0.0
  | | `-- strip-ansi@4.0.0
  | |   `-- ansi-regex@3.0.0
  | +-- strip-ansi@5.2.0
  | | `-- ansi-regex@4.1.0
  | `-- through@2.3.8
  +-- metalsmith@2.3.0
  | +-- absolute@0.0.1
  | +-- chalk@1.1.3
  | | +-- ansi-styles@2.2.1
  | | +-- has-ansi@2.0.0
  | | | `-- ansi-regex@2.1.1
  | | +-- strip-ansi@3.0.1
  | | | `-- ansi-regex@2.1.1
  | | `-- supports-color@2.0.0
  | +-- clone@1.0.4
  | +-- co-fs-extra@1.2.1
  | | +-- co-from-stream@0.0.0
  | | | `-- co-read@0.0.1
  | | +-- fs-extra@0.26.7
  | | | +-- jsonfile@2.4.0
  | | | `-- klaw@1.3.1
  | | `-- thunkify-wrap@1.0.4
  | |   `-- enable@1.3.2
  | +-- gray-matter@2.1.1
  | | +-- ansi-red@0.1.1
  | | | `-- ansi-wrap@0.1.0
  | | +-- extend-shallow@2.0.1
  | | | `-- is-extendable@0.1.1
  | | +-- js-yaml@3.13.1
  | | | +-- argparse@1.0.10
  | | | | `-- sprintf-js@1.0.3
  | | | `-- esprima@4.0.1
  | | `-- toml@2.3.6
  | +-- has-generators@1.0.1
  | +-- is@3.3.0
  | +-- is-utf8@0.2.1
  | +-- recursive-readdir@2.2.2
  | +-- stat-mode@0.2.2
  | +-- thunkify@2.1.2
  | +-- unyield@0.0.1
  | | `-- co@3.1.0
  | +-- ware@1.3.0
  | | `-- wrap-fn@0.1.5
  | `-- win-fork@1.1.1
  +-- minimatch@3.0.4
  | `-- brace-expansion@1.1.11
  |   +-- balanced-match@1.0.0
  |   `-- concat-map@0.0.1
  +-- multimatch@2.1.0
  | +-- array-differ@1.0.0
  | +-- array-union@1.0.2
  | | `-- array-uniq@1.0.3
  | `-- arrify@1.0.1
  +-- ora@1.4.0
  | +-- cli-spinners@1.3.1
  | `-- log-symbols@2.2.0
  +-- read-metadata@1.0.0
  | `-- yaml-js@0.0.8
  +-- request@2.88.0
  | +-- aws-sign2@0.7.0
  | +-- aws4@1.9.0
  | +-- caseless@0.12.0
  | +-- combined-stream@1.0.8
  | | `-- delayed-stream@1.0.0
  | +-- extend@3.0.2
  | +-- forever-agent@0.6.1
  | +-- form-data@2.3.3
  | | `-- asynckit@0.4.0
  | +-- har-validator@5.1.3
  | | +-- ajv@6.10.2
  | | | +-- fast-deep-equal@2.0.1
  | | | +-- fast-json-stable-stringify@2.1.0
  | | | +-- json-schema-traverse@0.4.1
  | | | `-- uri-js@4.2.2
  | | |   `-- punycode@2.1.1
  | | `-- har-schema@2.0.0
  | +-- http-signature@1.2.0
  | | +-- assert-plus@1.0.0
  | | +-- jsprim@1.4.1
  | | | +-- extsprintf@1.3.0
  | | | +-- json-schema@0.2.3
  | | | `-- verror@1.10.0
  | | |   `-- core-util-is@1.0.2
  | | `-- sshpk@1.16.1
  | |   +-- asn1@0.2.4
  | |   +-- bcrypt-pbkdf@1.0.2
  | |   +-- dashdash@1.14.1
  | |   +-- ecc-jsbn@0.1.2
  | |   +-- getpass@0.1.7
  | |   +-- jsbn@0.1.1
  | |   `-- tweetnacl@0.14.5
  | +-- is-typedarray@1.0.0
  | +-- isstream@0.1.2
  | +-- json-stringify-safe@5.0.1
  | +-- mime-types@2.1.25
  | | `-- mime-db@1.42.0
  | +-- oauth-sign@0.9.0
  | +-- performance-now@2.1.0
  | +-- qs@6.5.2
  | +-- safe-buffer@5.2.0
  | +-- tough-cookie@2.4.3
  | | +-- psl@1.6.0
  | | `-- punycode@1.4.1
  | +-- tunnel-agent@0.6.0
  | `-- uuid@3.3.3
  +-- rimraf@2.7.1
  | `-- glob@7.1.6
  |   +-- fs.realpath@1.0.0
  |   +-- inflight@1.0.6
  |   | `-- wrappy@1.0.2
  |   +-- inherits@2.0.4
  |   +-- once@1.4.0
  |   `-- path-is-absolute@1.0.1
  +-- semver@5.7.1
  +-- tildify@1.2.0
  | `-- os-homedir@1.0.2
  +-- uid@0.0.2
  +-- user-home@2.0.0
  `-- validate-npm-package-name@3.0.0
    `-- builtins@1.0.3

创建一个基于 webpack 模板的新项目

# 创建一个基于 webpack 模板的新项目
$ vue init webpack my-project
# 这里需要进行一些配置,默认回车即可
This will install Vue 2.x version of the template.

For Vue 1.x use: vue init webpack#1.0 my-project

? Project name my-project
? Project description A Vue.js project
? Author runoob <test@runoob.com>
? Vue build standalone
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Setup unit tests with Karma + Mocha? Yes
? Setup e2e tests with Nightwatch? Yes

   vue-cli · Generated "my-project".

   To get started:
   
     cd my-project
     npm install
     npm run dev
   
   Documentation can be found at https://vuejs-templates.github.io/webpack

进入项目,安装并运行:

$ cd my-project
$ cnpm install
$ cnpm run dev
 DONE  Compiled successfully in 4388ms

> Listening at http://localhost:8080

成功执行以上命令后访问 http://localhost:8080/,输出结果如下所示:

vue-cli脚手架的安装第2张

免责声明:文章转载自《vue-cli脚手架的安装》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇zaHDFS文件读写过程下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

webpack4.0打包失败的探索

①:运行命令npx webpack index.js 打包index.js文件失败,如下图提示 度娘说是因为没有设置webpack为生产或开发模式,于是我在package.json文件中添加如下代码 "scripts": { "dev":"webpack –-mode development", "build": "webpack –-...

Vue2.x+Element-UI+TypeScript2.x + ThreeJS + PaperJS + EChart3.x+ArcGIS 集成例子笔记

项目Git地址:https://github.com/linqingwudiv1/VueTypeScriptArcGISTemplate TypeScript完美解决JS/ES的常见弊端。用TS来实现一些:如单例/代理工厂,命令模式等传统的设计模式还不是美滋滋。 更新:3.0的vue-cli已经集成了TS选项..Vue-Cli Doc: https://c...

vue-cli3.0和element-ui及axios的安装使用

一、利用vue-cli3快速搭建vue项目 Vue CLI 是一个基于 Vue.js 进行快速开发的完整系统。有三个组件: CLI:@vue/cli 全局安装的 npm 包,提供了终端里的vue命令(如:vue create 、vue serve 、vue ui 等命令) CLI 服务:@vue/cli-service是一个开发环境依赖。构建于 web...

vue前端工程化

今日目标 1.能够了解模块化的相关规范 2.了解webpack3.了解使用Vue单文件组件4.能够搭建Vue脚手架5.掌握Element-UI的使用 1.模块化的分类 A.浏览器端的模块化 1).AMD(Asynchronous Module Definition,异步模块定义)代表产品为:Require.js2).CMD(Common Module D...

vue 动态加载图片路径报错解决方法

最近遇到图片路径加载报错的问题 之前一直都是把图片放到assets的文件下的。总是报错,看到一些文章并且尝试成功了,特意记录下 首先先说明下vue-cli的assets和static的两个文件的区别,因为这对你理解后面的解决办法会有所帮助  assets:在项目编译的过程中会被webpack处理解析为模块依赖,只支持相对路径的形式,如< img sr...

vite首次启动加载慢

背景 随着vue3的到来,vite开始被各大vue3组件库使用,公司开始一个新项目,准备尝试用vite试一波。 问题发现 当把公司新项目移植到vite后,启动非常快,但发现页渲染时间慢了很多 可以看到页面的首屏加载时间是3.34s,页面的渲染完时间是3.37s,下载总大小是8.6MB,发送了119个请求 在看看webpack的渲染时间: 可以看到页面...