Appendix: Vue Setup on a Local Machine

Learn how to set up a Vue development environment on a local machine.

Vue setup

We can install the Vue CLI globally as follows:

npm install -g @vue/cli

Here, we are using npm to install the Vue CLI and making it available globally with the -g flag. Once it’s installed, we can check the version of the Vue CLI as follows:

vue -v 

Here, we are invoking the Vue CLI, which is simply called vue, and using the -V flag to retrieve the currently installed version.

@vue/cli 5.0.8

Here, we can see that our globally installed version of the Vue CLI is at version 5.0.8. With the CLI installed, we can now create a Vue application as follows:

vue create shopping-cart

Here, we are invoking the Vue CLI with the option create, which will create a Vue application, as well as the directory we wish to create the application in, which is shopping-cart. Once the CLI is invoked, it will prompt us with a few questions on how we wish to configure our application. To configure Vue to use TypeScript, we must select “Manually select features” as the option for the first question, which is “Please pick a preset.”

The features that we will need for our project are shown in the following screenshot:

Get hands-on with 1200+ tech skills courses.