Reputation: 135
I have some nodejs apps in some folder, and it seems i cannot run any mocha test, when i run npm test or mocha test i get this:
/home/jmartinez/uni/mis_practicas/p5-t1-egg-0-alu0100921038/node_modules/mocha/lib/cli/run-helpers.js:84
exports.handleRequires = async (requires = []) =>
^
SyntaxError: Unexpected token (
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/jmartinez/uni/mis_practicas/p5-t1-egg-0-alu0100921038/node_modules/mocha/lib/cli/options.js:15:16)
I tried reinstalling mocha again but nothing, the error persists, and i don't know how to fix it, i was just installing like everybody else. This errors happens across every nodejs app so its seems like a installation problem, but reinstalling didnt solve it.
I'm using node version v6.17.1
Upvotes: 1
Views: 1409
Reputation: 135
Well, seems like the version 6 for nodejs is quite old. I upgraded to the 12 and now its working.
Upvotes: 2