Exercism exercise: jasmine-node . - command not found - node.js

I'm trying to run the first exercise in Exercism. I have followed the readme instructions and installed Homebrew, and then installed the CLI. Everything went fine.
I then typed in the command line to download the first test - Hello World. Again, this worked fine.
The next instruction was
Execute the tests with:
jasmine-node .
I assume this is to be typed into Terminal? This is what I've tried and it says 'command not found'. There is no other instructions. I've never even come across Jasmine before. I downloaded jasmine-node separately via npm,
npm install jasmine-node -g
...but this has still made no difference.
Can anyone suggest where I am going wrong? Thanks.

I think you are looking for this link
http://exercism.io/languages/javascript/installing
It details all the dependencies you need to install
the command that did it for me was
npm install jasmine-node -g

Related

What does the npx command install?

This question is about understanding how the npx command works and what it exactly does under the hood. (The documentation does not really help - see below)
From the documentation:
Installation-less command execution
There is another great feature of npx, which is allowing to run
commands without first installing them.
Great. Let's try running some command without installation:
npx node#6 -v
And in result one gets:
Need to install the following packages:
node#6
Ok to proceed? (y)
So there is anyway installation going on. And one could see that something gets installed with npm cache ls.
If we run the command npx node#6 -v again, there won't be a prompt asking for installation. That means the installation (that didn't happen in the first place) persists. And now one could execute the command even without connection to the internet/npm.
For a person who does not know all nuts and bolts of the npm it is kind of strange to find "installation-less execution", which asks for installation.
Could some one give more logical explanation like: when you execute npx node#6 -v this and that happens under the hood, this package will be downloaded and unpacked there ... then executed ... then deleted/or persists for so long ... and so on.
What if I run npx package today (and it gets "installed") and I run the command in 3 months? Would npx check if there is a newer version or would it call the "installed" one?
Is there a documentation on that?

yarn is not recognized as a command on git bash in windows

I installed yarn using npm: npm i -g yarn
when I execute the command yarn -v or any other yarn command on cmd or PowerShell it Outputs the Version
But on GitBash it displays: C:\Users\<my_username>\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found
I even tried Reinstalling Node & Yarn but it still doesn't work.
1 solution I found is that instead of yarn if I use yarn.cmd then it works in GitBash.
But I'm unable to find the reason & the correct solution for this problem. If someone has any Idea please Guide me.
I tried so many things and in the end I'm not sure which really worked. Maybe you find out that another step works in your case.
So here's some of the sensible things I did:
I reinstalled node, yarn and git because that's the default behavior of a man in confusion. (Didn't work)
Tried manipulating PATH although yarn was recognized from cmd and powershell. (Didn't work)
I found this: https://yarnpkg.com/getting-started/install. It seems like they updated the installation steps. So I tried that because it was something different from the yarn installation you and I used... It worked!
Now, if the last step was the one that worked, make sure to run npm uninstall -g yarn after

bash: create-react-app: command not found (pretty sure it's my $PATH)

Let me preface by stating that this is my first post, and also I can’t retrace my steps to where the create-react-app command no longer works in my Terminal. Last week, when I was practicing how to work with ReactJS I was able to use the command create-react-app and had been able to initialize a React project. However, I’ve been fiddling plentifully with NodeJS and NPM stuff simultaneously, and now when I call the create react-app command this is the output:
bash: create-react-app: command not found
I’m pretty sure it has to do with my $PATH, however I’m not experienced with making edits through vim
when editing my .bash_profile. In my attempts to diagnose and fix the problem, here is what I appended to my $PATH through vim:
export PATH="/usr/local/bin:$PATH"
Nevertheless, I know the order of $PATH matters, but I’m naive as to whether I should prepend or append the $PATH above?
Here is what is output when I echo $PATH:
/usr/local/heroku/bin:/usr/local/bin:/usr/local/sbin:~/bin:/Users/bjornjohnramos/.rbenv/bin:/Users/bjornjohnramos/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/bjornjohnramos/.npm-packages/bin/express
-> /Users/bjornjohnramos/.npm-packages/lib/node_modules/express-generator/bin/express-cli.js:/Users/bjornjohnramos/.npm-packages/lib:export
PATH="/usr/local/bin:$PATH":export
PATH=$PATH:/Users/my_name/.npm-packages/bin/
my node and npm versions:
node v6.9.1
npm 4.2.0
Who knows what happened? But maybe we can just fix it by reinstalling...
npm uninstall create-react-app
npm uninstall create-react-app -g
npm install create-react-app -g
The first two commands will uninstall create-react-app locally and globally. (Not sure how you may have installed it. Harmless to run both.) The third installs globally, and should set up the path for you as needed.
use command npx create-react-app my-app rather than using npx create-react-app my-app that will resolves your bash: create-react-app: command not found err on windows.
Hope this is helpful
Happy coding...

Not able to run 'npm install' on vagrant homestead

I'm trying to install Gulp & Elixir on my Laravel project but I keep getting errors when I run 'npm install'. I've also tried 'sudo npm install' but no luck there.
My Node version is: 1.4.14
It switches between these two:
For this error there was a solution posted here: https://harvsworld.com/2015/how-to-fix-npm-install-errors-on-vagrant-on-windows-because-the-paths-are-too-long/
But this has not solved the issue seeing it still happens after following the steps.
I also sometimes get these errors (the list goes on...):
Anyone know a solution? I haven't found anything yet after a couple hours of searching..
After a long search I eventually found the solution.
Seeing I'm using Homestead / Vagrant, I was using PuTTY. This was my first mistake.
Just simply use Git Bash, just make sure you run it as an administrator &
change the directory to your Laravel project.
The second thing you need to do is make sure you don't have a 'node_modules' file in your project. Just remove the files by doing:
rm -rf node_modules/
Followed by:
npm install
Everything should work now. It's a dumb mistake but hopefully through this post, people will not make the same one as I did and waste alot of time doing it..
Cheers!
You should first install node in your local machine.
Then, navigate to your project folder and run (again on your local machine!):
npm install gulp --save-dev

Testing Hubot locally in Ubuntu

Hi Stackoverflow community,
Well the thing is that I'm working on a script for hubot. Before starting to code I'm trying to test some hubot commands in the command line (I already did it in Windows but for some reasons I've to change to Ubuntu environment to start to code this brand new custom hubot) I'd like to be able to write in the terminal >Hubot PING and get a response PONG to start to work.
Till now I've already installed Node.js through nodenv https://github.com/OiNutter/nodenv and I tested my node >node -v, got v0.10.22. I forked my hubot and cloned locally and then apply ~./hubot> npm install to get all the dependencies and everything seems OK. Then I went to the installation folder >cd node_modules/hosted-hubot which has a folder called bin, inside the hubot folder.
So, till this point everything seemed OK and I tried to do in the command line: ./bin/hubot and I'm not able to run hubot locally, it gave me: nodenv: version `v0.8' is not installed. I tried to install an older version of node 0.8 and got the same message.
So that's it, hope you guys can help me to try to test my hubot locally
Thanks in advance!!!
I made a fresh install and I instal node.js without nodenv and everything works properly. It may not be the better solution but it was what I did.

Resources