在 Choose a version of Vue.js that you want to start the project with (Use arrow keys)(选择项目的 Vue.js 版本) 选择 2.x
1 2 3 4 5 6
Vue CLI v4.5.15 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex ? Choose a version of Vue.js that you want to start the project with (Use arrow keys) > 2.x 3.x
在 Use history mode for router?(路由使用history模式) 中回答 n,不使用 history模式 。
Vue CLI v4.5.15 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex ? Choose a version of Vue.js that you want to start the project with 2.x ? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) n
在Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys) (选择Babel, ESLint 等等第三方包的配置文件) 中选择 In dedicated config files(在专用的配置文件中)
1 2 3 4 5 6 7 8
Vue CLI v4.5.15 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex ? Choose a version of Vue.js that you want to start the project with 2.x ? Use history mode for router? (Requires proper server setup for index fallback in production) No ? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys) > In dedicated config files In package.json
在Save this as a preset for future projects? (保存刚才的选择到项目预设) 中回答 n。
1 2 3 4 5 6 7
Vue CLI v4.5.15 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex ? Choose a version of Vue.js that you want to start the project with 2.x ? Use history mode for router? (Requires proper server setup for index fallback in production) No ? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files ? Save this as a preset for future projects? (y/N)
Vue CLI v4.5.15 ? Please pick a preset: Manually select features ? Check the features needed for your project: Choose Vue version, Babel, Router, Vuex ? Choose a version of Vue.js that you want to start the project with 2.x ? Use history mode for router? (Requires proper server setup for index fallback in production) No ? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files ? Save this as a preset for future projects? No
Vue CLI v4.5.15 ✨ Creating project in D:\sources\vue_repos\acme-world-app. 🗃 Initializing git repository... ⚙️ Installing CLI plugins. This might take a while...
yarn install v1.22.5 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "win32" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. Done in 20.52s. 🚀 Invoking generators... 📦 Installing additional dependencies...
yarn install v1.22.5 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "win32" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages...
success Saved lockfile. Done in 5.25s. ⚓ Running completion hooks...
📄 Generating README.md...
🎉 Successfully created project acme-world-app. 👉 Get started with the following commands:
$ cd acme-world-app $ yarn serve
WARN Skipped git commit due to missing username and email in git config, or failed to sign commit. You will need to perform the initial commit yourself.
运行项目
进入创建好的项目文件夹
根据项目创建完成后倒数第二行提示,输入命令:cd acme-world-app
1 2
PS D:\sources\vue_repos> cd acme-world-app PS D:\sources\vue_repos\acme-world-app>
在 Visual Studio Code 中打开项目
方法一: 启动 Visual Studio Code, 选择打开文件夹, 选中D:\sources\vue_repos\acme-world-app 打开。
以后在项目的控制台中运行命令:yarn dev 或npm run dev 就可以启动开发服务器,并自动打开默认浏览器显示运行的结果了。
启动项目
在控制台输入命令:yarn dev, 项目运行成功后将看到内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
PS D:\sources\vue_repos\acme-world-app> yarn dev yarn run v1.22.5 $ vue-cli-service serve --open INFO Starting development server... 98% after emitting CopyPlugin
PS D:\sources\vue_repos\acme-world-app> yarn add element-ui yarn add v1.22.5 [1/4] Resolving packages... warning element-ui > async-validator > babel-runtime > core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, 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 version of core-js. [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "win32" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved lockfile. success Saved 8 new dependencies. info Direct dependencies └─ element-ui@2.15.6 info All dependencies ├─ async-validator@1.8.5 ├─ babel-helper-vue-jsx-merge-props@2.0.3 ├─ babel-runtime@6.26.0 ├─ element-ui@2.15.6 ├─ normalize-wheel@1.0.1 ├─ regenerator-runtime@0.11.1 ├─ resize-observer-polyfill@1.5.1 └─ throttle-debounce@1.1.0 Done in 6.71s.
PS D:\sources\vue_repos\acme-world-app> yarn add leancloud-storage yarn add v1.22.5 [1/4] Resolving packages... warning leancloud-storage > leancloud-realtime > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. warning leancloud-storage > @leancloud/platform-adapters-node > @leancloud/adapters-superagent > superagent > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau [2/4] Fetching packages... info fsevents@2.3.2: The platform "win32" is incompatible with this module. info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.13: The platform "win32" is incompatible with this module. info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [4/4] Building fresh packages...