Use npm to quickly build the first vue project

Use npm to quickly build the first vue project

Prerequisite: Make sure that node.js is installed and the corresponding environment variables are correctly configured

Enter node --versionto see if the corresponding version number information can appear


insert image description here


First create an empty folder and open it with vscode


insert image description here


Create a new terminal ( in the top bar of vscode, select the terminal, then pull down to select the new terminal ), enter npm init vue@latest, and then configure it by default


insert image description here
insert image description here


npm init 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

Scaffolding project in ./<your-project-name>...
Done.

Install dependencies and start the development server:

cd vue-project # 自己的项目名
npm install
npm run dev

insert image description here


Access from the browser (http://localhost:5173)


insert image description here


Relevant code:


insert image description here


The first vue project is built

Guess you like

Origin blog.csdn.net/m0_63622279/article/details/130539465