SyntaxError: Use of const in strict mode
Closed this issue · 4 comments
Hi
I have the following error when I try to test it
pi@mmdvm:/MMDVMHost-utils/examples $ nodejs -v/MMDVMHost-utils/examples $ nodejs test.js
v0.10.29
pi@mmdvm:
/home/pi/MMDVMHost-utils/examples/test.js:3
const MMDVMHost = require('../index.js');
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
Could you help me?
Regards!
It may be that you have an older version of node.js installed than I do. You could try running it like this, which may help:
nodejs --harmony test.js
Or you could try updating node.js. I'm using 6.11.3 here.
Hi
OMG I'm ussing v0.10.29 it is the last version according to apt-get install nodejs
I have install nodejs following this tutorial -> http://thisdavej.com/upgrading-to-more-recent-versions-of-node-js-on-the-raspberry-pi/
nodejs -v
v8.6.0
Now has a updated version but i have the follow error
module.js:529
throw err;
^
Error: Cannot find module 'tail'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object. (/home/pi/MMDVMHost-utils/lib/logdriver.js:8:14)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)
May be could be better a guide to install all necesary components? What's missing?
Regards !!
I have fixed the tail error installing with
npm install tail
But now i need to install INI
module.js:529
throw err;
^
Error: Cannot find module 'ini'
fixed with -> npm install ini
Now:
odule.js:529
throw err;
^
Error: Cannot find module 'chokidar'
fixed with -> npm install chokidar
NOW IT IS WORKING!! THANKS!!!
Sorry, I should have included some installation instructions. Just running 'npm install' would have installed all the dependencies specified in 'package.json'. (This is typical of node.js modules.)