One: Global Install VUE-CLI
1. Install VUE-CLI
NPM install-g VUE-CLI
When I installed the code, I had an error, I performed the rm-rf/usr/lib/node_modules/vue-cli to remove the previous installation, reinstall it, through
2. # Create a new project based on the ' Webpack ' template
Vue Init webpack My-project
3. # Install dependencies, walk you
CD My-project
NPM Install
When performing NPM install, the error was caused by network problems, I executed
CNPM Install
Pass.
4. Through the above, we have completed the installation, the following implementation (develop way):
Since I'm on the Aliyun, so I need to configure the IP
Open File: My-project/build/dev-server.js
Modify the URI to:
var uri = ' http://120.24.37.249: ' + port
You can switch to your own IP.
If you want to replace the port, you can modify it in My-project/config/index.js:
Dev: {
env:require ('./dev.env '),
port:8080,
Change the 8080 to the port you want
Enter the My-project directory and execute
NPM Run Dev
, the log executed is:
Done Compiled successfully in 5078ms 1:03:18 PM
> listening at http://120.24.37.249:8080
You can then access the following:
http://120.24.37.249:8080/
:
https://segmentfault.com/a/1190000006852262
https://segmentfault.com/a/1190000006852262
NPM Run Dev