happypoulp / redux-tutorial

Learn how to use redux step by step
3.76k stars 546 forks source link

import reserved word? #26

Closed Jakobud closed 9 years ago

Jakobud commented 9 years ago

I'm using node 0.12.7. When I get to step 3,

(function (exports, require, module, __filename, __dirname) { import { createS
                                                              ^^^^^^
SyntaxError: Unexpected token import
    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 Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

import is a reserved word? What version of node do I need to be using to run this? Doesn't the latest have ES6 features in it?

happypoulp commented 9 years ago

Did you use this command to run your example: npm run example 03_about-state-and-meet-redux.js ?

All examples are made to be run with babel-node through npm run example command.npm install should install everything that you need.

Jakobud commented 9 years ago

Aha! I totally missed that. I was just doing npm --harmony 03_about-state-and-meet-redux.js. Thanks!