使用SyntaxError进行流星测试失败:意外的保留字

时间:2017-03-14 22:17:51

标签: meteor

当我运行命令meteor test --driver-package practicalmeteor:mocha时,我收到以下错误:

W20170314-15:20:44.067(-4)? (STDERR) /tmp/meteor-test-runfh1j93/.meteor/local/build/programs/server/packages/znewsham_justplay-common.js:971
W20170314-15:20:44.068(-4)? (STDERR) import { Random } from 'meteor/random';
W20170314-15:20:44.068(-4)? (STDERR) ^^^^^^
W20170314-15:20:44.068(-4)? (STDERR) 
W20170314-15:20:44.069(-4)? (STDERR) SyntaxError: Unexpected reserved word
W20170314-15:20:44.069(-4)? (STDERR)     at Object.exports.runInThisContext (vm.js:53:16)
W20170314-15:20:44.070(-4)? (STDERR)     at /tmp/meteor-test-runfh1j93/.meteor/local/build/programs/server/boot.js:289:30
W20170314-15:20:44.072(-4)? (STDERR)     at Array.forEach (native)
W20170314-15:20:44.073(-4)? (STDERR)     at Function._.each._.forEach (/home/danilo/.meteor/packages/meteor-tool/.1.4.2_6.wp5fef++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20170314-15:20:44.074(-4)? (STDERR)     at /tmp/meteor-test-runfh1j93/.meteor/local/build/programs/server/boot.js:128:5
W20170314-15:20:44.074(-4)? (STDERR)     at /tmp/meteor-test-runfh1j93/.meteor/local/build/programs/server/boot.js:344:5
W20170314-15:20:44.075(-4)? (STDERR)     at Function.run (/tmp/meteor-test-runfh1j93/.meteor/local/build/programs/server/profile.js:480:12)
W20170314-15:20:44.076(-4)? (STDERR)     at /tmp/meteor-test-runfh1j93/.meteor/local/build/programs/server/boot.js:343:11

我没有在我运行它的所有机器上得到它,也没有在不使用测试时出现。

我尝试重新安装node,npm,meteor,删除node_modules并重新安装和安装babel-present-meteor。

我之前遇到过这个问题,但它要么自行消失,要么就是我当时试过的数百件事之一摆脱它 - 但我现在无法让它运转起来。有什么想法吗?

流星版是1.4.2.6 节点是v4.7.3 npm是4.1.2

1 个答案:

答案 0 :(得分:0)

importexport字是ECMAScript 2015

的一部分

您能否确保安装了ecmascript软件包?

https://docs.meteor.com/packages/ecmascript.html