mocha: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/mocha - from package: mocha
/usr/lib/node_modules/mocha/bin/mocha - from package: mocha

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/mocha - from package: mocha
/usr/lib/nodejs/mocha/bin/mocha - from package: mocha

You may install the required package with command apt-get install {package}
Error in other languages:
mocha: bevel nie gevind nie
mocha: comandă negăsită
mocha: comando não encontrado
mocha: commande introuvable
mocha: command not found
mocha: käsku ei ole
mocha: không tìm thấy lệnh
mocha: komanda nerasta
mocha: Kommando nicht gefunden.
mocha: kommandot finns inte
mocha: komut yok
mocha: nie znaleziono polecenia
mocha: níor aimsíodh an t-ordú
mocha: no se encontró la orden
mocha: no s'ha trobat l'ordre
mocha: opdracht niet gevonden
mocha: parancs nem található
mocha: perintah tidak ditemukan
mocha: príkaz nenájdený
mocha: příkaz nenalezen
mocha: команда не найдена
mocha: командата не е открита
mocha: 命令找不到
mocha: コマンドが見つかりません