There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
Agree with a comment or answer? Like () to up-vote the contribution!
Hi all, I see no one seems to have had any issue with this section…but I can’t get past step 1!
I’ve initialized the project as per instructions and created package.json file in the project directory and also hit check work, but I cannot move to step 2.
Looking at the mocha documentation, the command to install mocha as a devDependency is npm install --save-dev mocha but in this exercise, we are told to use npm install mocha -D. Can someone clarify which of these is the correct way to install mocha as a development dependency?
Thanks for clarifying! It’s weird that there would be two ways instead of one standardized way of installing devDependencies. I wish codecademy listed both when teaching this lesson.
I have a question: i can not install mocha to my google drive directory where I develop my codes usually by VS code. Why? The normal hard disk local directory was ok. Thank you.
I’m unable to install mocha. it gives me this error:
Sorry, name can only contain URL-friendly characters and name can no longer contain capital letters.
Hello, this may be a late reply already. I encountered the same problem when I was coding, had a bit of confusion in it until I reviewed the link on their documentation. First you initialize the project with $npm init as said in the first step, then afterwards you enter npm-help-json then just go with the flow, check your answer and you’ll be able to advance to step 2.
-D signifies that this package is a development dependency and will show up under the devDependecies section in package.json. This means that the package will only be included in development mode and will not be included in the production bundle.
What is meant by ‘production bundle’?
Also, why is there no field in package.json called ‘dependencies’? I was experimenting and tried installing mocha without the -D expecting it to appear as: "dependencies": { "mocha": "^10.0.0" } but it didn’t show up at all.
I’m trying to follow instruction but can still not get past the first step. I start with writing npm init, then I write npm-help-json but no futher instructions are given. The only thing that shows after I’ve typed npm-help-json is a version number. It feels like it isnt working as inteded or am I missing something?
Same here, npm init does not work, in order to move to the next steps, I just used View Solution, then replace answers with Solution, and then everything worked out.
Once you type npm init there about 6-7 prompts you just have to hit enter on. The last one will say is this okay?(yes) just hit enter again. THEN you type npm install mocha -D and it should work fine.