Reputation: 9866
I went through the process of installing the VolumioUI on Ubuntu as explained in this link.
and I 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
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 Module.require (module.js:364:17)
at require (module.js:380:17)
at /home/yossi/elia/Volumio2-UI/gulpfile.js:19:3
at Array.map (native)
at Object.<anonymous> (/home/yossi/elia/Volumio2-UI/gulpfile.js:18:4)
at Module._compile (module.js:456:26)
I did the same process on MAC with no problems.
This is very strange since it complains about a syntax error.
if I change it to ' than it works fine, the problem is that the code is full of this error.
Can I config NodeJs to treat ` as ' ?
Note: I was able to solve it by search-and-replace, but I leave this question open because I would like to know if it can be solved with a config
$ node --version
v0.10.25
Upvotes: 2
Views: 5920
Reputation: 41
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
This is the solucion with the problem for Invalid or unexpected token when you use npm install.
Upvotes: 4
Reputation: 19895
Backticks are part of the new syntax introduced in the latest version of Javascript (ES6).
The problem occurs, because you have a (very) old version of node, which does not implement this new syntax. Probably, you have node v.0.10 instead of node v.7
The solution is to upgrade node.js.
Here is 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
Upvotes: 7
Reputation: 203231
Backticks are different from single quotes, they aren't interchangeable by means of setting a configuration option somewhere.
You need a relatively recent Node.js version (v4.4.2 or up, I think) that supports the backtick ("template literal") syntax.
Upvotes: 0