paulyoung / fontello-cli

Command line interface for fontello.
MIT License
88 stars 30 forks source link

Not backward compatible. #26

Closed codingmatty closed 8 years ago

codingmatty commented 8 years ago

After installing from npm, the following makes fontello-cli unusable:

/usr/local/lib/node_modules/fontello-cli/node_modules/needle/node_modules/qs/lib/index.js:5
const Stringify = require('./stringify');
^^^^^
SyntaxError: Use of const in strict mode.
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/fontello-cli/node_modules/needle/lib/needle.js:13:19)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
codingmatty commented 8 years ago

Looks like you aren't compatible with older versions of node.. Executing node --harmony /usr/local/lib/node_modules/fontello-cli --help yields no output.

rishabh-ink commented 8 years ago

It looks like hapijs/qs are planning to support only Node v4 and above (see hapijs/qs#124), hence this issue. I too faced the same issue on my Node v0.12.7 installation. In my case, upgrading to Node v4.2.2 LTS helped resolve it.

simison commented 8 years ago

+1

Noticed the same with qs yesterday. My app isn't yet Node v4 compatible and I don't have time for it right now, so I just switched for https://www.npmjs.com/package/gulp-fontello instead. :P

rishabh-ink commented 8 years ago

If upgrading to Node v4+ is not possible, then a temporary workaround can be made by shrinkwrap-ing qs and locking down its version to v5.2.0.

Committing an npm-shrinkwrap.json file into your repo with the following contents would do the trick:

{
  "name": "your-project-name",
  "dependencies": {
    "qs": {
      "version": "5.2.0",
      "from": "qs@v5.2.0",
      "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz"
    }
  }
}

After adding the above file, run npm install as usual. npm will install qs v5.2.0.

paulyoung commented 8 years ago

Sorry, everyone, for the lack of response here.

I'm not totally clear on the best way forward here but if there's a strong consensus I'll try to make that happen.

codingmatty commented 8 years ago

I personally just upgraded node and it works fine.