Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to setup Jasmine for my Javascript project

Tags:

jasmine

I have created a JavaScript project and need to use Jasmine for unit testing. I have followed following steps :
1. npm install jasmine --save-dev - from project root directory
2. Now when I try to initilize it using
           jasmine init
It is giving me the below error. 'jasmine' is not recognized as an internal or external command, operable program or batch file.
Any lead to solve the issues will be appreciated.

like image 747
Gaurav Avatar asked Jan 25 '17 07:01

Gaurav


2 Answers

Had the same problem (using Windows). Just do this:

npm install -g jasmine

It is now recognizable.

like image 57
John Doe Avatar answered Nov 19 '22 14:11

John Doe


If you have installed it locally in your project you can use the following from the root path of project.

npx jasmine init

Reference- https://jasmine.github.io/setup/nodejs.html

Need not install globally.

like image 38
Aarushi Mishra Avatar answered Nov 19 '22 15:11

Aarushi Mishra