How to do it...

For this recipe, we will need the command line and npm, so be sure to have it installed before moving ahead.

In a new folder, create a file named package.json and write the following inside it:

{  "name": "my-vue-project",  "version": "1.0.0"}

Just having this file in your folder creates a new npm project. We will edit this file later.

In your command line, go to the directory where your project is and type the following command inside it to install the necessary dependencies:

npm install --save-dev vue karma jasmine karma-jasmine karma-chrome-launcher

This will install Vue along with Karma, Jasmine, and a couple of plugins of Karma as dependencies of our project.

If you take a look at the package.json now, you will see ...

Get Vue.js 2 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.