Setting up a new project with Vue.js 2 can be done in different ways. We are going to use the Vue cli
In order to use the Vue-cli we need to install NPM as the Vue-cli is available as an NPM package
after installing NPM we can install the vue-cli as follows
npm install -g vue-cli
After installing the Vue cli we can use the cli command to create a new project
vue init webpack myfirstvueapp
after executing the above line vue will ask a number of questions. If you did not let vue run the install you can do that manually by using the following command from within the project folder
npm install
after installation is complete you can launch the web server in development mode as follows
npm run dev
this will launch the web server. The web server will launch on port 8080 by default if the port is available. If the port is in use the port number will increase until an open port is found.
Later when you want to build for production you can use the following command
npm run build
this will build the production code which will then be available under the dist folder.