0

我是 Meteor 的新手,只是尝试安装并运行一个新的应用程序。上周五我的工作正常,但今天不得不重新安装,无法再让应用程序运行。

安装是一个挑战。尝试在 Windows 上安装,发现安装程序不起作用。求助于提取 tar.gz 文件。此外,由于公司限制,必须安装到备用位置(%LocalAppData% 中的默认值已被策略锁定)。但是,正如我所说,这在上周有效,但今天无法正常工作。本周,团队中的其他人也开始看到这一点。第一次运行meteor时,它更新到meteor-tool到1.5.2.2,然后更新各种包。ejson 包是一个,并且更新到 1.0.14。如果我运行meteor update它说项目已经在 1.5.2.2。(最新的)和顶级依赖项是最新的兼容版本。我该如何解决?谢谢!

控制台输出:

C:\dev\R&D\meteor\meteor-test>meteor
[[[[[ C:\dev\R&D\meteor\meteor-test ]]]]]

=> Started proxy.
=> Started MongoDB.
W20171020-14:19:35.920(-5)? (STDERR) C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\packages\ejson.js:749
W20171020-14:19:36.013(-5)? (STDERR)       for (let i = 0; i < length; i += 1) {
W20171020-14:19:36.016(-5)? (STDERR)            ^^^
W20171020-14:19:36.018(-5)? (STDERR)
W20171020-14:19:36.019(-5)? (STDERR) SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
W20171020-14:19:36.021(-5)? (STDERR)     at Object.exports.runInThisContext (vm.js:53:16)
W20171020-14:19:36.022(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:332:30
W20171020-14:19:36.023(-5)? (STDERR)     at Array.forEach (native)
W20171020-14:19:36.025(-5)? (STDERR)     at Function._.each._.forEach (C:\dev\programs\.meteor\packages\meteor-tool\1.5.2_2\mt-os.windows.x86_32\dev_b
undle\server-lib\node_modules\underscore\underscore.js:79:11)
W20171020-14:19:36.026(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:158:5
W20171020-14:19:36.028(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:388:5
W20171020-14:19:36.029(-5)? (STDERR)     at Function.run (C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\profile.js:510:12)
W20171020-14:19:36.031(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:387:11
=> Exited with code: 1
W20171020-14:19:40.739(-5)? (STDERR) C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\packages\ejson.js:749
W20171020-14:19:40.741(-5)? (STDERR)       for (let i = 0; i < length; i += 1) {
W20171020-14:19:40.745(-5)? (STDERR)            ^^^
W20171020-14:19:40.752(-5)? (STDERR)
W20171020-14:19:40.754(-5)? (STDERR) SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
W20171020-14:19:40.756(-5)? (STDERR)     at Object.exports.runInThisContext (vm.js:53:16)
W20171020-14:19:40.757(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:332:30
W20171020-14:19:40.759(-5)? (STDERR)     at Array.forEach (native)
W20171020-14:19:40.762(-5)? (STDERR)     at Function._.each._.forEach (C:\dev\programs\.meteor\packages\meteor-tool\1.5.2_2\mt-os.windows.x86_32\dev_b
undle\server-lib\node_modules\underscore\underscore.js:79:11)
W20171020-14:19:40.765(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:158:5
W20171020-14:19:40.767(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:388:5
W20171020-14:19:40.769(-5)? (STDERR)     at Function.run (C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\profile.js:510:12)
W20171020-14:19:40.771(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:387:11
=> Exited with code: 1
W20171020-14:19:45.026(-5)? (STDERR) C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\packages\ejson.js:749
W20171020-14:19:45.028(-5)? (STDERR)       for (let i = 0; i < length; i += 1) {
W20171020-14:19:45.030(-5)? (STDERR)            ^^^
W20171020-14:19:45.031(-5)? (STDERR)
W20171020-14:19:45.033(-5)? (STDERR) SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
W20171020-14:19:45.034(-5)? (STDERR)     at Object.exports.runInThisContext (vm.js:53:16)
W20171020-14:19:45.036(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:332:30
W20171020-14:19:45.037(-5)? (STDERR)     at Array.forEach (native)
W20171020-14:19:45.039(-5)? (STDERR)     at Function._.each._.forEach (C:\dev\programs\.meteor\packages\meteor-tool\1.5.2_2\mt-os.windows.x86_32\dev_b
undle\server-lib\node_modules\underscore\underscore.js:79:11)
W20171020-14:19:45.042(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:158:5
W20171020-14:19:45.043(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:388:5
W20171020-14:19:45.045(-5)? (STDERR)     at Function.run (C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\profile.js:510:12)
W20171020-14:19:45.047(-5)? (STDERR)     at C:\dev\R&D\meteor\meteor-test\.meteor\local\build\programs\server\boot.js:387:11
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.
4

1 回答 1

0

在 Meteor 中编写代码时必须注意语法。尽管 Meteor 运行在 Node.JS 之上,但它运行在比大多数 NodeJS 项目(NodeJS被认为是 LTS)更旧的版本(例如 Meteor1.5与 NodeJs 捆绑)上。v4.8.x6.x

在您的情况下,您似乎在循环let内部使用。for直到 NodeJS 7.x( source ) 才支持这种语法。相反,使用var(这是较旧的 Javascript 标准)。

在使用 Meteor 时,我强烈建议使用预编译语言(如Typescript),因为它使您能够使用与更高版本的 Meteor 兼容的现代语法(Node8.x将成为 Meteor 的一部分1.6)。

于 2017-10-24T06:02:07.650 回答