Jasmine: command not found

Hi,

I installed jasmine globally, but cannot get it to run. I run npm view jasmine version and it shows I got the latest version 3.1.0.

When I go to the the exercise directory and run jasmine helloWorld.spec.js, I get the following output: bash: jasmine: command not found.

Any idea what is going wrong?

Thanks!

J

Hi,
If you run npm install jasmine or If jasmine is a dependency / devDependcy in your package.json and you have run npm install, jasmine is installed into the local node_modules folder and then you can run jasmine like this node_modules/.bin/jasmine.

if you install it globally npm install jasmine -g then can run it like this jasmine.

Yarn should work exactly the same.

Hi Malaika,

I was having the exact problem with OP but your solution solved my issue by trying node_modules/.bin/jasmine.

Is there a way to change that to just simply typing in jasmine?

Do I have to uninstall jasmine and re-install?

Thanks!

Edit:

Uninstalling jasmine and reinstalling did not help :confused:

Hey, I just started the exercise that requires Jasmine and I am also getting the error “zsh: command not found: jasmine”, when I try to run the “jasmine helloWorld.spec.js” command.

I went through the entire process of installing nvm / node and they seemed to install properly because I can see the latest versions when I try to enter it in the terminal.

But when I try to run “npm install jasmine -g”, “npm install -g jasmine”, “npm install jasmine-node -g”, etc. again, I get “zsh: command not found: npm” again.

Do any of you know what could be causing this and how to fix it?

I found this stackoverflow thread and one of the recommendations was to add “source /Users/ user_Name /.bash_profile” to the top of my .zshrc file and that seemed to make things work. Will update if I still run into any more issues