C:\Users\Administrator>vue init webpack vue3-demo
? Project name vue3-demo
? Project description a Vue.js project
? Author howard2005
? Vue build (Use arrow keys)
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests Yes
? Pick a test runner jest
? Setup e2e tests with Nightwatch? Yes
? Should we run `npminstall`for you after the project has been created? (recom
? Should we run `npminstall`for you after the project has been created? (recom
mended)npm
vue-cli · Generated "vue3-demo".# Installing project dependencies ...# ========================npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser
. This package will no longer receive updates.
npm WARN deprecated [email protected]: This loader has been deprecated. Please
use eslint-webpack-plugin
npm WARN deprecated [email protected]: Deprecated. Please use ht
tps://github.com/webpack-contrib/mini-css-extract-plugin
npm WARN deprecated [email protected]: out of support
npm WARN deprecated [email protected]: core-js@<3.4 is no longer maintained and not
recommended for usage due to the number of issues. Because of the V8 engine whi
ms, feature detection in old core-js versions could cause a slowdown up to 100x
even if nothing is polyfilled. Please, upgrade your dependencies to the actual v
ersion of core-js.
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Br
owserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: request has been deprecated, see https://git
hub.com/request/request/issues/3142
npm WARN deprecated [email protected]: support for ECMAScript is superseded by `ug
lify-js` as of v3.13.0
npm WARN deprecated [email protected]: Chokidar 2 does not receive security updates
since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated [email protected]: Switch to the `bfj` package for fixes and n
ew features!npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older v
ersions may use Math.random()in certain circumstances, which is known to be pro
blematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer suppor
ted. Please update to mkdirp 1.x. (Note that the API surface has changed to use
Promises in1.x.)npm WARN deprecated [email protected]: Please use the native JSON object instead of JS
ON 3npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and coul
d be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated [email protected]: flatten is deprecated in favor of utility fra
meworks such as lodash.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, fl
atted is its successor.
npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Bro
wserslist >3.0 config used in other tools.
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrad
e to v2.x.x.
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support f
or node <10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at leas
t 2.1.6 to avoid a serious bug with socket data flow and an import issue introdu
ced in2.1.0
npm WARN deprecated [email protected]: The querystring API is considered Legacy.
new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrad
e to v2.x.x.
npm WARN deprecated [email protected]: use String.prototype.padStart()npm WARN deprecated [email protected]: request-promise-native has bee
n deprecated because it extends the now deprecated request package, see https://
github.com/request/request/issues/3142
npm WARN deprecated [email protected]: See https://github.com/lydell/sour
ce-map-resolve#deprecatednpm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#dep
recated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprec
ated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-m
ap-url#deprecated>[email protected]install C:\Users\Administrator\vue3-demo\node_modules\chro
medriver
> node install.js
Current existing ChromeDriver binary is unavailable, proceding with download and
extraction.
Downloading from file: https://chromedriver.storage.googleapis.com/2.46/chromed
river_win32.zip
Saving to file: C:\Users\Administrator\AppData\Local\Temp\2.46\chromedriver\chro
medriver_win32.zip
Received 781K...
Received 1568K...
Received 2352K...
Received 3136K...
Received 3920K...
Received 4523K total.
Extracting zip contents
Copying to target path C:\Users\Administrator\vue3-demo\node_modules\chromedrive
r\lib\chromedriver
Done. ChromeDriver binary available at C:\Users\Administrator\vue3-demo\node_mod
ules\chromedriver\lib\chromedriver\chromedriver.exe
>[email protected] postinstall C:\Users\Administrator\vue3-demo\node_modules\core-
js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js )for polyfill
ing JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Colle
ctive or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a goo
d job -)>[email protected] postinstall C:\Users\Administrator\vue3-demo\node_modules\es5-
ext
> node -e "try{require('./_postinstall')}catch(e){}">[email protected] postinstall C:\Users\Administrator\vue3-demo\nod
e_modules\webpack\node_modules\uglifyjs-webpack-plugin
> node lib/post_install.js
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.3 (node_modules\sa
ne\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.2.13: wanted {
"os":"darwin","arch":"any"}(current: {
"os":"win32","arch":"x64"})npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\ch
okidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
2.3.2: wanted {
"os":"darwin","arch":"any"}(current: {
"os":"win32","arch":"x64"})npm WARN [email protected] requires a peer of ajv@^5.0.0 but none is installed.
You must install peer dependencies yourself.
added 1836 packages from 1115 contributors in104.944s
Running eslint --fix to comply with chosen preset rules...
# ========================>[email protected] lint C:\Users\Administrator\vue3-demo
> eslint --ext .js,.vue src test/unit test/e2e/specs "--fix"# Project initialization finished!# ========================
To get started:
cd vue3-demo
npm run dev
Documentation can be found at https://vuejs-templates.github.io/webpack
C:\Users\Administrator>
(二)运行Vue项目
进入项目,执行命令:cnpm run dev
(三)浏览器查看应用运行结果
访问http://localhost:8080
四、使用Vite创建Vue项目
(一)Vite简介
Vite 是一个 web 开发构建工具,由于其原生 ES 模块导入方式,可以实现闪电般的冷服务器启动。
使用 Vite 快速构建 Vue 项目的语法格式:npm init vite-app <project-name>