0
votes

I'm trying to install the polymer CLI from here: https://www.polymer-project.org/1.0/docs/tools/polymer-cli

However, after installing it I get an error when trying to run polymer help:

[~/Documents/roottest]$ polymer help                                                                                                                                                                                   ruby:2.2.4

/opt/boxen/nodenv/versions/v0.10.26/lib/node_modules/polymer-cli/bin/polymer.js:19
  let lib = path ? require(path) : require('..');
  ^^^
SyntaxError: Unexpected strict mode reserved word
    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:902:3
[~/Documents/roottest]$ node --version                                                                                                                                                                                 ruby:2.2.4
v0.10.26
[~/Documents/roottest]$ nodenv --version                                                                                                                                                                               ruby:2.2.4
nodenv 0.3.3

My node version is v0.10.26, my nodeenv version is 0.3.3. I'm using Mac.

Does anyone know how I would fix this?

1
Do you have 'use strict'; line included in the beginning of the file? The ^^^ are poiting at 'let' which is ES6 syntax, the older versions of Node.js don't support it out of the box as far as I know. - Azamantes
where? i am just trying ton install polymer cli - bigpotato
'let' is another version of creating a variable in Javascript, it requires EcmaScript 6 support. There are some flags you can pass to node when tryiing to execute a file, harmony might be the keyword you're looking after. - Azamantes

1 Answers

1
votes

Polymer CLI is not compatible with Node v0.10.26.

The setup guide indicates that Node 4.x or newer is required. You should actually upgrade to the latest stable version (6.2.0).

enter image description here