Skip to content

SyntaxError when running extract.js #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hbielenia opened this issue Jul 22, 2017 · 3 comments
Closed

SyntaxError when running extract.js #2

hbielenia opened this issue Jul 22, 2017 · 3 comments

Comments

@hbielenia
Copy link

Running this command:
node node_modules/vue-webpack-gettext/extract --output i18n/template.pot --src src

Gives me following error:

let finalAttrs = extractAttrs
^^^

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:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:140:18)
    at node.js:1043:3```

Node v4.8.4.
@kennyki
Copy link
Owner

kennyki commented Jul 22, 2017

Hi there, this is caused by missing 'use strict'; and there are 2 ways you can get around it:

  1. Recommended: Upgrade your node to later version - the stable version is v6.11.1 as of now (https://nodejs.org/en)
  2. Add flag --use_strict to the command. It has been deprecated though.

@hbielenia
Copy link
Author

NodeSource repo was giving me some problems and this is the newest version available from Debian's own repos. The second solution works well, though. Thanks!

Think it could be worthy to add this compatibility info to readme?

@kennyki
Copy link
Owner

kennyki commented Jul 27, 2017

Thanks for the suggestion. However I will add this to the readme if there's more request :-)

@kennyki kennyki closed this as completed Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants