1

I am trying to follow this tutorial Testing in Node.js and used the following command for installing mocha

sudo npm install -g mocha

Got the following response:

npm WARN deprecated [email protected]: Renamed to supports-color. If you're using chalk, upgrade to the latest version. https://github.com/chalk/supports-color
/usr/local/bin/mocha -> /usr/local/lib/node_modules/mocha/bin/mocha
/usr/local/bin/_mocha -> /usr/local/lib/node_modules/mocha/bin/_mocha
[email protected] /usr/local/lib/node_modules/mocha
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected])

But running mocha in my project directory doesn't generate any response:

lingxiao@computer:~/dir/to/proj$ find *
lib
lib/tags.js
node_modules
node_modules/chai
node_modules/chai/CONTRIBUTING.md
...
node_modules/chai/index.js
test
test/tagsSpec.js
lingxiao@computer:~/dir/to/proj$ mocha
lingxiao@computer:~/dir/to/proj$ which mocha
/usr/local/bin/mocha

Anyone knows what the problem is?

lingxiao
  • 1,214
  • 17
  • 33
  • What do you see when you just type `mocha`? I am not sure what you mean by "doesn't generate any response". – Chris Jan 27 '16 at 01:39
  • it didn't give any response like nothing happened. lingxiao@computer:~/dir/to/proj$ mocha lingxiao@computer:~/dir/to/proj$ which mocha /usr/local/bin/mocha – lingxiao Jan 27 '16 at 01:42
  • 1
    Perhaps your problem is similar to [this one](https://groups.google.com/forum/#!topic/mochajs/ock19UfMKQc)? – Chris Jan 27 '16 at 01:45
  • 1
    thank you Chris, exactly that problem. also the solution is here: http://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04 – lingxiao Jan 27 '16 at 01:50
  • `sudo apt-get --purge remove node` `sudo apt-get --purge remove nodejs` `sudo apt-get install nodejs` in sequence solved the problem – lingxiao Jan 27 '16 at 01:51

0 Answers0