【发布时间】:2019-03-07 08:00:54
【问题描述】:
我只是按照官方网站的步骤:
第一步。
npm install --save next react react-dom
步骤 2. 在 package.json 中添加脚本
{
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start"
}
}
第 3 步。 在项目中添加 ./pages/index.js:
export default () => <div>Welcome to next.js!</div>
然后我运行 npm run dev 并得到错误:
/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
我哪里做错了?
【问题讨论】:
-
什么是sharedState,是对象还是数组?
-
看到这个答案,我不认为这与 next.js 本身有关。看到这个答案:stackoverflow.com/questions/38748445/…
-
@ArrowHead 您好,感谢您的帮助。我发现我的节点版本太旧了,所以发生了错误。它在节点更新后工作。
-
我很高兴你找到了答案。
标签: next.js