How does Xiaobai start the Vue project?

First check if node.js is installed

node -v

After that, the command line will return the specific version number on the local computer

After that, we need to install vue scaffolding. We generally use vue.cli to learn vue, but because the npm server is abroad, the download speed is too slow, so first
download the npm Taobao mirror through the domestic Taobao mirror

npm config set registry https://registry.npm.taobao.org

Then install vue development scaffolding vue.cli

npm install -g @vue/cli

After that, change to the directory of the project you want to create and create the project with the command

vue create xxx${projectName}

If you want to create your own Vue project, then execute the following command

cd xxx${projectName}
npm run serve

If you need to go to github to pull other people's projects to start, after cloning the project, you don't need to create a vue project, go to the directory where the project is located and execute the command

npm i

There may be a lot of errors reported in the middle, let's ignore it first, and then click to open the package.json file
insert image description here

View the configuration item information inside:
insert image description here

So go to the terminal and execute the command

npm run dev


But if you are a front-end novice, then it is very likely that an error will be reported. The error message is as follows:
insert image description here

This shows that you do not have node-sass installed, please refer to this article to install node-sass: https://blog.csdn.net/qq_40028324/article/details/103274971


Then execute the npm run dev command, and an error may be reported at this time:
insert image description here

See this article for the solution: [Node Sass version 8.0.0 is incompatible with ^4.0.0. Problem solved]

Finally, run the npm run dev command, and the result is successful!
insert image description here

Author Kuchiki, I hope you can avoid pitfalls after reading this article!

Guess you like

Origin blog.csdn.net/Your_Boy_Tt/article/details/129296042