获取“未捕获的错误:断言失败:Ember 视图需要 1.7 和 2.1 之间的 jQuery"使用通过 ember-cli 创建的应用程序 [英] Getting "Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1" with app created through ember-cli
问题描述
我从 ember 开始.我遵循了 emberjs.com 上的入门指南,并通过运行以下命令设法创建了一个新的 ember 应用程序:
I'm starting with ember. I followed the Getting Started guide at emberjs.com and managed to create a new ember application by running the following commands:
npm install -g ember-cli
ember new sample-app
一切顺利,我可以看到 ember-cli 生成的应用程序文件.不久之后,我做到了:
Everything went successful and I can see the app files generated by ember-cli. Soon after that I did:
ember server
命令行显示:
version: 1.13.13
Livereload server on http://localhost:49153
Serving on http://localhost:4200/
Build successful - 4426ms.
Slowest Trees | Total
----------------------------------------------+---------------------
ConcatWithMaps: Concat: Vendor | 3498ms
Slowest Trees (cumulative) | Total (avg)
----------------------------------------------+---------------------
ConcatWithMaps: Concat: Vendor (1) | 3498ms
当我访问 http://localhost:4200 时,问题就出现了.没有加载任何内容,Chrome 控制台显示以下内容:
The problem comes when I go to http://localhost:4200. Nothing gets loaded and the Chrome console is showing the following:
Uncaught Error: Assertion Failed: Ember Views require jQuery between 1.7 and 2.1
Uncaught Error: Could not find module `ember` imported from `sample-app/app`
我试图通过重新安装 ember-cli、bower 和 npm 来解决这个问题,但没有任何效果.
I tried to fix this by reinstalling ember-cli, bower and npm but nothing is working.
以下是必要的附加信息:
Here's additional info in case is necessary:
$ ember -v
version: 1.13.13
node: 5.4.0
npm: 2.14.10
os: darwin x64
$ npm -v
3.5.3
$ bower -v
1.7.2
非常感谢帮助.提前致谢!
Help is much appreciated. Thanks in advance!
推荐答案
这是由于 ember 尚无法处理的新版本 jQuery 导致的错误.现在,您可以更改 bower.json
文件中的以下行.然后运行 bower install
就可以了.
This is a bug due to a new version of jQuery which ember is not yet able to handle. For now you can change the following line in your bower.json
file. Then run bower install
and it should work.
"jquery": "^1.11.3",
到
"jquery": "1.11.3",
ember.js 的新版本是即将推出,它应该会修复
A new version of ember.js is imminent which should fix this.
这篇关于获取“未捕获的错误:断言失败:Ember 视图需要 1.7 和 2.1 之间的 jQuery"使用通过 ember-cli 创建的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!