Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Now issue the command to install Chai globally.

Now issue the command to install Chai globally.

Samuel Ferree
Samuel Ferree
31,722 Points

Can you post the command you think should work?

2 Answers

Alexisca hall:

JavaScript Unit Testing > Behavior Driven Development > Getting Started with Mocha and Chai or Installing Chai Code Challenge

The correct code to use in your terminal at your Command Prompt is: $npm install --save-dev mocha chai, as per the Teacher's Notes in the above lesson. Then hit the Enter key. The -g flag installs Mocha.js & Chai.js globally. You don't need to spell out the word "globally" for it to work. Installing it this way includes both of them in your package.json file in your "development dependencies." Be sure to check your package.json file to make sure they were installed correctly.

Otherwise, (Installing Chai Code Challenge) to just install Chai.js itself, then you type: $npm install -g chai. Works the same way. Check your package.json file to make sure it was installed under your "development dependencies" in your package.json file.

When you get stuck on a question, click the "Get Help" button. Then identify the lesson on which you're stuck on, like I did with the right pointing arrows above, & include your code. There's a button at the bottom of the "text of your question" box for you to click on for it to automatically upload under the correct category on the Community Page. It also categorizes your question under "JavaScript" & shows the sub-categories like above in ovals at the bottom of your question. Otherwise, if you post your question under "General Discussion" area, it will get buried & you won't receive a timely answer from another Treehouse student. You also have the option to "ask" someone once you submitted your correction.

npm install -chai. works try it