0

I'm new to Meteor, and only trying to install and get a new app running. I had things were working last Friday, but had to reinstall today and can no longer get the app running.

The install has been a challenge. Trying to install on Windows, and have found the installers just don't work. Resorted to extracting a tar.gz file. Also, due to company restrictions, had to install to an alternate location (the default in %LocalAppData% is locked down by policy). But, as I said, this was working last week, but can't get it working today. Others on the team started seeing this, this week too. When running meteor for the first time, it updates to meteor-tool to 1.5.2.2, then updates various packages. The ejson package is one, and is updated to 1.0.14. If I run meteor update it says project is already at 1.5.2.2. (the latest) and top-level dependencies are at their latest compatible versions. How do I fix this? Thanks!

Console Output:

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.
03T
  • 49
  • 1
  • 10

1 Answers1

0

You have to be careful about syntax when writing code in Meteor. Although Meteor runs ontop of Node.JS, it runs on an older version (Meteor 1.5 is bundled with NodeJs v4.8.x for instance) than most NodeJS projects (NodeJS6.x is considered LTS).

In your case, it looks like you are using let inside of a for loop. It doesn't look like this syntax is supported until NodeJS 7.x (source). Instead, use var (which is the older Javascript standard).

When working with Meteor, I would highly suggest using a pre-compiled language (like Typescript), as it enables you to use modern syntax which will be compatible with later versions of Meteor (Node 8.x will be a part of Meteor 1.6).

Derek Brown
  • 4,232
  • 4
  • 27
  • 44
  • Unfortunately, the syntax in error is inside a dependent package (ejson), and is a problem after simply running `meteor create meteor-test` from the command line - not any code of my own. I understand what you are saying, and the error message(s) support that claim, but if that is, in fact, true, that implies Meteor is broken (at least on Windows). – 03T Nov 13 '17 at 15:59