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

JavaScript

HanJoon Kim
seal-mask
.a{fill-rule:evenodd;}techdegree
HanJoon Kim
Full Stack JavaScript Techdegree Student 15,388 Points

Why am I getting the different results when running "mocha" and "npm test" ?

HanJoonui-MacBook-Pro:final hanjoonkim$ npm test

> final@1.0.0 test /Users/hanjoonkim/Downloads/WorkStation/TeamTreeHouse/unit-testing-mocha/2-behavior-driven-development-with-mocha-chai/1-getting-started-with-mocha-and-chai/final
> mocha

module.js:557
    throw err;
    ^

Error: Cannot find module './options'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/hanjoonkim/Downloads/WorkStation/TeamTreeHouse/unit-testing-mocha/2-behavior-driven-development-with-mocha-chai/1-getting-started-with-mocha-and-chai/final/node_modules/.bin/mocha:11:16)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
npm ERR! Test failed.  See above for more details. 
HanJoonui-MacBook-Pro:final hanjoonkim$ mocha


  0 passing (2ms)

I made sure that the folder name is "test" as instructed on the lecture, "Javascript Unit Testing: General Structure of Test Files"

1 Answer

Samuel Ferree
Samuel Ferree
31,722 Points

can you dump the contents of your project.json file?