node.js - How to install mocha js for Nodejs? -


on ubuntu system nodejs verison v0.10.25 , nop version 1.3.10. when tried install mochajs testing getting following error

user@ubuntu:~/mochatest$ sudo npm install -g mocha npm err! error: cannot find module 'fstream' npm err!     @ function.module._resolvefilename (module.js:338:15) npm err!     @ function.module._load (module.js:280:25) npm err!     @ module.require (module.js:364:17) npm err!     @ require (module.js:380:17) npm err!     @ object.<anonymous> (/usr/lib/nodejs/tar/lib/entry.js:14:15) npm err!     @ module._compile (module.js:456:26) npm err!     @ object.module._extensions..js (module.js:474:10) npm err!     @ module.load (module.js:356:32) npm err!     @ function.module._load (module.js:312:12) npm err!     @ module.require (module.js:364:17) npm err! if need help, may report log at: npm err!     <http://github.com/isaacs/npm/issues> npm err! or email to: npm err!     <npm-@googlegroups.com>  npm err! system linux 3.13.0-36-generic npm err! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "mocha" npm err! cwd /home/mochatest npm err! node -v v0.10.25 npm err! npm -v 1.3.10 npm err! code module_not_found npm err!  npm err! additional logging details can found in: npm err!     /home/mochatest/npm-debug.log npm err! not ok code 0 

i don't know version of mocha setup trying install, because me mocha noes not rely on fsteam

├─┬ mocha@2.3.3 │ ├── commander@2.3.0 │ ├─┬ debug@2.0.0 │ │ └── ms@0.6.2 │ ├── diff@1.4.0 │ ├── escape-string-regexp@1.0.2 │ ├─┬ glob@3.2.3 │ │ ├── graceful-fs@2.0.3 │ │ ├── inherits@2.0.1 │ │ └─┬ minimatch@0.2.14 │ │   ├── lru-cache@2.7.0 │ │   └── sigmund@1.0.1 │ ├── growl@1.8.1 │ ├─┬ jade@0.26.3 │ │ ├── commander@0.6.1 │ │ └── mkdirp@0.3.0 │ ├─┬ mkdirp@0.5.0 │ │ └── minimist@0.0.8 │ └── supports-color@1.2.0 

maybe npm needs it... try installing npm, if not work consider reinstalling nodejs.

also, maybe related, on macos ? if so, ensure /var/lib/node_modules , ~/.npm have correct right on it.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -