问题描述
首先,我将使用--harmony标志启动Node.我在Eclipse首选项> Nodeclipse>节点选项"中设置了该标志
First off, I am starting Node with the --harmony flag. I set this flag in Eclipse "Preferences > Nodeclipse > node options"
问题显示在.js文件本身中.
The problems show in the .js files themselves.
例如,我在一个控制器中有一个generator方法...
For instance, I have a generator method in one of my controllers...
show: function* () { ... }
Nodeclipse在具有生成器功能的所有.js文件上显示错误.它显示红色"x"并显示消息...
Nodeclipse is showing an error on all .js files with generator functions.It displays the red "x" with the message...
Syntax error on "*". Delete this token.
由于我使用的大多数节点模块都具有生成器功能,所以我在项目中遇到500个错误.
Since most of node modules I use have generator functions, I have like 500 errors in the project.
有人知道如何解决这个问题吗?
Anyone know how to fix this?
推荐答案
a)获取Nodeclipse 1.1 http://www .nodeclipse.org/history
a) get Nodeclipse 1.1 http://www.nodeclipse.org/history
或
b)手动执行:
删除.project中的JSDT性质
remove JSDT nature in .project
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
在.jshintrc中启用ES6
in .jshintrc enable ES6
"esnext" : true, // Allow ES.next (ECMAScript 6) specific features such as `const` and `let`.
这篇关于Nodeclipse无法识别生成器功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!