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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.