To create a new Vue.js project using the Vue CLI, you can use the following command:
vue create my-project-name
This will start the Vue CLI project creation wizard, which will guide you through the process of creating a new project.
Here are the steps:
- The first step will ask you to pick a preset. You can choose between manually selecting features or using a preset. If you are new to Vue.js, it is recommended to choose the default preset.
- The next step will ask you to configure additional settings such as Babel and ESLint. You can accept the defaults or customize them according to your needs.
- Once the project is created, navigate to the project directory.
- Run the following command to start the development server.
npm run serve
This command will start the development server, and you can access your new Vue.js project by visiting
http://localhost:8080/ in your browser.
The Vue CLI also offers other commands that can help you generate new components, views, and other files, as well as build and test your application. You can see the full list of commands by running
vue --help in the terminal.