Under Mac to install and configure Vue project

Inscription: vue school for some time, finally decided today to write a daily commitment to study notes.
1. Access node.js official website: https://nodejs.org/en/  download the corresponding installation package.

2. The complete installation, in a terminal:

node -v

 

If the version number is returned, on behalf of the installation was successful. Prior to the proposed installation directory permissions, as to how to directory permissions, not described here, a lot of online information.

3. Install Taobao mirror
as to why you want to install Taobao mirror, because there tabernacle blocking our access npm offshore sites; strong curiosity friends can try, bad luck for a long, long time, there may be a night time, do not ask me how knew.
BS, in a terminal:

Elevation install g cnpm --registry = https: // registry.npm.taobao.org

 

Enter the installation is complete:

asl -v

 

View the version number, the correct return represents the installation is complete, whether in start over.

4. Install webpack
future we will fight for a long time and webpack dealings, will be used to create a project. Enter in a terminal:

cnpm install webpack -g

 

5. Install vue scaffolding
This tool is a tool to automatically set up the framework of the project vue, fairly easy to use, only this one did not have a choice.
Input Terminal:

sudo npm install -g vue-cli

 

6. Wait for a period of time, you can listen to the song "Fujian like you", this song is good, according to Zhao's; Keke, but also beside the point, after installation is complete, enter in a terminal:

vue list

 

View details, return to success on behalf of the following, no, again.


Create your first project vue

1. Create a folder on a Mac, since his own name, and then open the directory in the terminal can also be opened with vscode, enter in a terminal:

sudo init view webpack vue_project

 


Wait for the installation to complete.
2. After the installation is successful handover to the handover to the terminal in the root directory of the project

cd vue_peoject

 

3. Install program dependent, in a terminal:

sudo install asl

 

4. After installation dependent complete, start the project, the terminal or the input terminal vscode:

npm run dev

 

5. Access http: // localhsot: 8080, open vue project
the way, believe that here, vue project can be a normal run. I also noticed that I basically will use sudo, so why then? In the Mac and Ubuntu, file permissions it is very annoying, without this order, all kinds of inexplicable problems occur, in order to reduce trouble, of course, I was lazy, simply are together, sure.

Guess you like

Origin www.cnblogs.com/c546170667/p/11273209.html