CrocoDillon / universal-react-redux-boilerplate

Step by step creation of a Universal React + Redux Boilerplate
Other
176 stars 33 forks source link

return async function serve (ctx, next) error #32

Closed aagentah closed 7 years ago

aagentah commented 7 years ago

Hi there, so after downloading, running npm install, building and then running "npm start", I get the following error in my CMD:

C:\Users\Dan\Desktop\dj_dev\universal-react-redux-boilerplate-master\node_modules\koa-static\index.js:39
    return async function serve (ctx, next) {
                 ^^^^^^^^
SyntaxError: Unexpected token function
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Dan\Desktop\dj_dev\universal-react-redux-boilerplate-master\lib\index.js:25:17)
    at Module._compile (module.js:570:32)

Currently running windows 10, any help or advice is appreciated - thank you in advance!

CrocoDillon commented 7 years ago

What Node version are you running? See http://node.green/#ES2017-features-async-functions for async function support.

If you're running an older version and can't upgrade I can help you get the right Babel plugin installed.

aagentah commented 7 years ago

Turns out my Node was outdated - rookie mistake, many thanks!

CrocoDillon commented 7 years ago

Hehe no problem, glad it's solved!