全局安装 vue-cli
npm install --global vue-cli
#创建一个基于 webpack 模板的新项目
vue init webpack my-project
E:\vuework\travel>cd travel
E:\vuework\travel\travel>npm install --global vue-cli
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated 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.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated vue-cli@2.9.6: This package has been deprecated in favour of @vue/cli
added 230 packages in 32s
npm notice
npm notice New minor version of npm available! 8.15.0 -> 8.19.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.19.2
npm notice Run npm install -g npm@8.19.2 to update!
npm notice
E:\vuework\travel\travel>cd ..
E:\vuework\travel>vue init webpack travel
? Target directory exists. Continue? Yes
? Project name travel
? Project description travel
? Author davicelee
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) npm
vue-cli · Generated "travel".
# Installing project dependencies ...
# ========================
#安装依赖,走你
cd my-project
npm install
npm run dev
二、git 项目同步 在git 上建立项目
在平台创建代码库。复制代码
在电脑上安装 git 程序
同步代码
git add .
git commit -m "vue init"
git push 推送到远程库