sveltejs / svelte-cli

Command line interface for Svelte
MIT License
104 stars 18 forks source link

Node version 6 required #4

Closed antstanley closed 7 years ago

antstanley commented 7 years ago

More a head's up, but the CLI fails if you're using node v4.6 with error below... upgrading to node v6.9.1 solved this for me..

Error below on v4.6

`/home/ubuntu/workspace/node_modules/svelte-cli/bin.js:607 const { sourceMap } = options; ^

SyntaxError: Unexpected token { 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:139:18) at node.js:974:3`

pwittchen commented 7 years ago

I had exactly the same problem on macOS and solved it by upgrade of the node.js as well. I used this instruction: https://solarianprogrammer.com/2016/04/29/how-to-upgrade-nodejs-mac-os-x/. On node v. 7.2.0 it works fine, but v. 4.6. throws errors as @antstanley reported. This tool should print more friendly error for the user. I see that there's a PR for that now.

Poetro commented 7 years ago

Also package.json does not say anything about required Node.js version, although it should. Or maybe it should be compiled to ES5 / CJS during build.

Ryuno-Ki commented 7 years ago

An engines entry is needed for this.

Rich-Harris commented 7 years ago

Related: https://github.com/sveltejs/svelte/issues/109

antstanley commented 7 years ago

I notice the engines entry in package.json has been updated. Will close this now.