carloscuesta / gitmoji-cli

A gitmoji interactive cli tool for using emojis on commits. 💻
https://www.npmjs.com/package/gitmoji-cli
MIT License
4.59k stars 206 forks source link

SyntaxError #65

Closed toby3d closed 7 years ago

toby3d commented 7 years ago

Hello @carloscuesta!

Issue: After change default NPM directory (for using installs/tools without sudo) I always get same error on any action via gitmoji. OS: Linux Mint Mate 18.2 (x64_86) gitmoji-cli -v: ??? Node version: v4.2.6 Error Message:

$ gitmoji -g
/home/toby3d/.local/lib/node_modules/gitmoji-cli/src/gitmoji.js:16
class GitmojiCli {
^^^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/toby3d/.local/lib/node_modules/gitmoji-cli/cli.js:7:20)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
carloscuesta commented 7 years ago

Hey @toby3d this is due to your NODE_VERSION v4.2.6 does not support the class keyword

toby3d commented 7 years ago

@carloscuesta Oops, you're right. :no_mouth:

carloscuesta commented 7 years ago

No problem! Maybe we should add this to the docs 😄

zwkcoding commented 6 years ago

How to solve it if NODE_VERSION v4.2.6 ? @carloscuesta

carloscuesta commented 6 years ago

Updating your NODE_VERSION to the LTS @zwkcoding

carloscuesta commented 6 years ago

On the next update, gitmoji-cli will not be installed if you don't have the minimum needed NODE_VERSION installed.

See https://github.com/carloscuesta/gitmoji-cli/commit/02e091cebddf2fc2e67bf7ac66ec1906ac967603