Gulp 为什么;“大口大口地开玩笑”;失败的原因是:“;请使用--harmony标志运行节点&引用;?

Gulp 为什么;“大口大口地开玩笑”;失败的原因是:“;请使用--harmony标志运行节点&引用;?,gulp,reactjs,jestjs,gulp-jest,Gulp,Reactjs,Jestjs,Gulp Jest,运行gulptest时出现以下错误: Error: Please run node with the --harmony flag! 以下是我的吞咽任务: var jest = require('gulp-jest'); gulp.task('test', function() { return gulp.src('src/**/__tests__').pipe(jest({ rootDir: 'src', scriptPreprocessor: '../node_mod

运行
gulptest
时出现以下错误:

Error: Please run node with the --harmony flag!
以下是我的吞咽任务:

var jest = require('gulp-jest');

gulp.task('test', function() {
  return gulp.src('src/**/__tests__').pipe(jest({
    rootDir: 'src',
    scriptPreprocessor: '../node_modules/6to5-jest',
    unmockedModulePathPatterns: [ 'react' ]
  }));
});
复制:

请注意,
npm测试
工作正常(测试按预期失败),但
gulp测试
因上述错误而失败。
npm测试
gulp测试
具有相同的配置对象:

{
  rootDir: 'src',
  scriptPreprocessor: '../node_modules/6to5-jest',
  unmockedModulePathPatterns: [ 'react' ]
}

我做错了什么?

这是
gulp eslint
中的一个错误,现在在0.3.0版中已修复。

据我所知,错误是从
jest cli
抛出的

使用
npm test
无法获得它的原因可能是您将npm配置为直接运行jest-bin脚本,该脚本用于以编程方式设置
--harmony
标志


您可以通过安装Coordinate并将
require('Coordinate')()
放在您的gulpfile中进行修复。

您是否尝试过执行错误指示的操作?我想了解为什么在
gulp test
中出现错误,而在
npm test中却没有出现错误。有什么想法吗?我遇到了相同的问题:(我在没有安装
gulp eslint
的情况下遇到了相同的错误,所以看起来好像是其他问题。请参阅我的问题。(顺便说一句:@steff的答案有效。)