3

I just follow the step from offical website:

https://nextjs.org/docs/

step 1.

npm install --save next react react-dom

step 2. Add a script to package.json

{
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start"
  }
}

step 3. Add ./pages/index.js inside project:

export default () => <div>Welcome to next.js!</div>

Then I ran npm run dev and got the error:

/Users/jh/Documents/worksapce/react/nextJs/test1/node_modules/webpackbar/dist/index.js:55
    const hasRunning = () => Object.values(sharedState).find(s => s.isRunning);
                                ^

TypeError: Object.values is not a function

Where am I doing wrong?

jimmy
  • 1,549
  • 5
  • 21
  • 38
  • 1
    What is sharedState, is it an object or an array? – ArrowHead Oct 02 '18 at 08:38
  • 1
    See this answer, I don't think this is related to next.js per se. See this answer: https://stackoverflow.com/questions/38748445/uncaught-typeerror-object-values-is-not-a-function-javascript – ArrowHead Oct 02 '18 at 08:40
  • 1
    @ArrowHead Hello, thanks for help. I found that my node version is too old, so that error happen. It works after node updated. – jimmy Oct 02 '18 at 09:14
  • 1
    I am happy you found the answer. – ArrowHead Oct 02 '18 at 13:32

1 Answers1

5

This is due to your node version. Please upgrade your node version. Node >= 7.0.0 fully supported this.

Kartik Bhalala
  • 390
  • 1
  • 10