create-react-app:模板是使用较旧版本的Handlebars预编译的

时间:2017-02-17 23:50:30

标签: reactjs npm handlebars.js create-react-app

我刚刚按照https://github.com/facebookincubator/create-react-app上的说明安装了create-react-app包。

之后我按照说明操作并创建了一个" myapp"应用程式:

$ create-react-app --version
1.0.4

$ create-react-app myapp

Creating a new React app in /home/...mydir.../myapp.

Installing packages. This might take a couple minutes.
Installing react-scripts...

在我已安装的软件包列表之后:

Success! Created myapp at /home/...mydir.../myapp
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd myapp
  npm start

Happy hacking!

好的,但是当我运行服务器时,我在浏览器控制台上收到了以下消息:

Template was precompiled with an older version of Handlebars than the current
runtime. Please update your precompiler to a newer version (>= 4.0.0) or downgrade
your runtime to an older version (>= 2.0.0-beta.1).

我已经验证了车把版本:

$ npm ls|grep handlebars
  │   │   └─┬ handlebars@4.0.6

我还尝试在" devDependencies"下的package.json设置把手版本。和"依赖"但那没有用。

关于如何解决这个问题的任何想法?

1 个答案:

答案 0 :(得分:2)

这是Code Climate Chrome扩展程序中的错误 如果你卸载它,错误就会消失。