Doubts with Mocha installation

I am trying to install mocha on my pc as explained by the full-stack course. When trying to do so with node the answer I get is “npm should be run outside of the Node.js REPL, in your normal shell” so I went over to my pc command window and installed it without problems.

My doubts start here: if I try to use mocha on node it is giving me issues - which I guess are linked to the fact that I didn’t downloaded mocha in node but I am not sure- but I don’t know if I can apply everything the system explains on my command window.

I am not very experienced so I am at loss how to proceed with this part. Please help a girl out

Hi @giselacepeda34900865

Welcome to the Codecademy Forums Community.

Could you please share with me what command it is that you originally tried to run?

I used npm unit just like the course suggested. I followed the instructions of the course. I can share the link of the specific module if needed?


Sorry, I had to do a bit of reading.

So from the sounds of things, it might be that you are running the mocha install using the node console (node.exe) which is what is causing the error. The error itself can be a bit confusing.

For the npm install files you shouldn’t use the node.js console to install them but just the regular command shell (cmd) instead.

The node.js console is more for running scripts. (I’m sure it is used for more than just that, however, i’m still fairly new when it comes to node.

Hope that makes sense.

What other issues are you having?

Don’t worry, I still appreciate your input. My main doubt is that the course says that we have to run things with node but I am fairly new to node myself so I don’t know what of the commands should actually be run through node and which through cmd

Ah! I see,

The easiest way to remember it is that if you wanna run a javascript file, you will run it through node. This is essentailly allowing you to run javascript files without having to use a browser.

When it comes to installing modules or anything with NPM, you will use the command shell (cmd/ command prompt).