node.js - ubuntu nodejs syntax error Syntax Error: Unexpected token ` -


i went through process of installing volumioui on ubuntu explained in this link.

and get:

/volumio2-ui$ gulp serve --theme="volumio"  /home/yossi/elia/volumio2-ui/gulp/build.js:127       fs.readfilesync(`${conf.paths.src}/app/themes/${themeselected}/assets/va                       ^ syntaxerror: unexpected token illegal     @ module._compile (module.js:439:25)     @ object.module._extensions..js (module.js:474:10)     @ module.load (module.js:356:32)     @ function.module._load (module.js:312:12)     @ module.require (module.js:364:17)     @ require (module.js:380:17)     @ /home/yossi/elia/volumio2-ui/gulpfile.js:19:3     @ array.map (native)     @ object.<anonymous> (/home/yossi/elia/volumio2-ui/gulpfile.js:18:4)     @ module._compile (module.js:456:26) 

i did same process on mac no problems.

this strange since complains syntax error.

if change ' works fine, problem code full of error.

can config nodejs treat ` ' ?

note: able solve search-and-replace, leave question open because know if can solved config

$ node --version v0.10.25 

backticks part of new syntax introduced in latest version of javascript (es6).

the problem occurs, because have (very) old version of node, not implement new syntax. probably, have node v.0.10 instead of node v.7

the solution upgrade node.js.

here how (ubuntu 14), see https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version

sudo npm cache clean -f sudo npm install -g n sudo n stable  sudo ln -sf /usr/local/n/versions/node/<version>/bin/node /usr/bin/nodejs 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -