1. vue-cli vue2/3 项目

// 全局安装 vue-cli
npm install -g @vue/cli

// 使用 vue-cli 创建项目
vue create ProjectName

2. create-react-app react 项目

// 全局安装 create-react-app
npm install -g create-react-app

// 使用 create-react-app 创建项目
create-react-app ProjectName

3. 使用 vite 安装 vue3 项目

3.1 方式一,框架选择配置安装
// 使用 vite 安装项目,这里 init 不能改为 i,i 是 install 的简写
npm init vite

// 项目名称
? Project name: » vite-project

// 选择要使用的框架,我这里选的是 Vue
? Select a framework: » - Use arrow-keys. Return to submit.
    vanilla
>   vue
    react
    preact
    lit
    svelte

// 使用 js 还是 ts、、、
? Select a variant: » - Use arrow-keys. Return to submit.
>   JavaScript
    TypeScript
    Customize with create-vue
    Nuxt
3.2 方式二,安装最新版 vue 项目,但是需要配置
npm init vue@latest
npm create vue@latest

✔ Project name:<your-project-name>
✔ Add TypeScript? … No / Yes
✔ Add JSX Support? … No / Yes
✔ Add Vue Router for Single Page Application development? … No / Yes
✔ Add Pinia for state management? … No / Yes
✔ Add Vitest for Unit testing? … No / Yes
✔ Add Cypress for both Unit and End-to-End testing? … No / Yes
✔ Add ESLint for code quality? … No / Yes
✔ Add Prettier for code formatting? … No / Yes
✔ Add Vue DevTools 7 extension for debugging? (experimental) … No / Yes // 这个是添加 DevTools,挺好用的

Scaffolding project in ./<your-project-name>...
Done.
3.3 方式三,直接安装
// 直接安装 Vue3 项目
npm init vite-app ProjectName

这几种安装方式都没有安装依赖包,需要进入文件 npm i 安装依赖包

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐