Meteor-Tool Error

Anyone knows how to fix this problem:

.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:218
      throw error;
              ^

SyntaxError: Unexpected string in JSON at position 23
    at JSON.parse (<anonymous>)
    at makeOptimistic (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/optimistic.ts:321:17)
    at wrap.makeCacheKey (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/optimistic.ts:36:15)
    at recomputeNewValue (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/entry.ts:182:31)
    at Slot.withValue (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/@wry/context/lib/context.js:73:29)
    at reallyRecompute (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/entry.ts:165:19)
    at Entry.recompute (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/entry.ts:85:9)
    at optimistic (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/index.ts:101:25)
    at wrap (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/optimistic.ts:363:19)
    at recomputeNewValue (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/entry.ts:182:31)
    at Slot.withValue (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/@wry/context/lib/context.js:73:29)
    at reallyRecompute (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/entry.ts:165:19)
    at Entry.recompute (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/entry.ts:85:9)
    at optimistic (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/optimism/src/index.ts:101:25)
    at find (/tools/isobuild/package-source.js:1286:25)
    at subdirectories.forEach.subdir (/tools/isobuild/package-source.js:1333:27)
    at Array.forEach (<anonymous>)
    at find (/tools/isobuild/package-source.js:1312:22)
    at subdirectories.forEach.subdir (/tools/isobuild/package-source.js:1333:27)
    at Array.forEach (<anonymous>)
    at find (/tools/isobuild/package-source.js:1312:22)
    at subdirectories.forEach.subdir (/tools/isobuild/package-source.js:1333:27)
    at Array.forEach (<anonymous>)
    at find (/tools/isobuild/package-source.js:1312:22)
    at find (/tools/isobuild/package-source.js:1344:25)
    at files.withCache (/tools/isobuild/package-source.js:1356:34)
    at Object.withCache (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/files.ts:1647:18)
    at PackageSource._findSources (/tools/isobuild/package-source.js:1356:18)
    at SourceArch.getFiles (/tools/isobuild/package-source.js:912:32)
    at /tools/isobuild/compiler.js:406:23
    at files.withCache (/tools/isobuild/compiler.js:186:28)
    at Object.withCache (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/files.ts:1647:18)
    at /tools/isobuild/compiler.js:185:11
    at Function._.each._.forEach (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:186:9)
    at Object.compile (/tools/isobuild/compiler.js:180:5)
    at /tools/isobuild/bundler.js:3238:24
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at bundle (/tools/isobuild/bundler.js:3185:31)
    at files.withCache (/tools/isobuild/bundler.js:3130:32)
    at Slot.withValue (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/lib/node_modules/@wry/context/lib/context.js:73:29)
    at Object.withCache (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/files.ts:1647:39)
    at Object.bundle (/tools/isobuild/bundler.js:3130:16)
    at Profile.run (/tools/runners/run-app.js:572:24)
    at Function.run (/Users/konstantinos/.meteor/packages/meteor-tool/.1.8.2.4w95ep.0y5nj++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/tool-env/tools/tool-env/profile.ts:289:14)
    at bundleApp (/tools/runners/run-app.js:571:34)
    at AppRunner._runOnce (/tools/runners/run-app.js:613:35)
    at AppRunner._fiber (/tools/runners/run-app.js:929:28)
    at /tools/runners/run-app.js:401:12

Thanks
K.

It likely means there’s a syntax error in your package.json or settings.json files. Check those for errors first. Keeping in mind that JSON is very specific, and comments or trailing commas will throw errors

It might point to an error with some other json imported into your app.

it could even be that Meteor’s cache has gotten corrupted, in which case, try meteor reset and failing that, deleting Meteor entirely (including removing /Users/konstantinos/.meteor/) and re-installing

I thought I replied to this but can’t see it. I tried all updating, resetting, un/installing but the problem persists. Is there anything on the console log error that might suggest where the problems might be.

It is from Meteor reading a package.json file in node_modules: https://github.com/meteor/meteor/blob/devel/tools/isobuild/package-source.js#L1286.

Running meteor npm ci might fix it since it deletes the node_modules folder and reinstalls all npm packages.

Or you can try to identify the package.json file with invalid json by setting the env variable TOOL_NODE_FLAGS="--inspect-brk" before starting Meteor. Then open chrome://inspect in Chrome and open the Node DevTools to add a breakpoint at https://github.com/meteor/meteor/blob/devel/tools/fs/optimistic.ts#L337. When the breakpoint is hit you can look at the path argument to see which file caused it.

I wasn’t lucky with meteor npm ci I guess that would be to easy for me :slight_smile:

I am very glad I came across the debug tool since I was wondering if something like it might exist.
I haven’t been able to understand though; is this the actual offensive bit shown in the screenshot below or something else, because this is also shown on the console when running meteor (without debugging). To me, it looks like this is the tool that the debugger is using to target the error. I am a bit ignorant about the mechanics of debugging and breakpoints insertion; providing that I need to add some, how do I know which package creates the issue to target at, some help at this point would be appreciated.

Same issue with version 2.3.6, did anyone get the solution? ?
Error:

/var/lib/jenkins/.meteor/packages/meteor-tool/.2.3.6.1mkn225.ud15++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:218
      throw error;
      ^

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /var/lib/jenkins/.meteor/packages/meteor-tool/.2.3.6.1mkn225.ud15++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/optimistic.ts:321:17

This issue happened again due to an external dependency (the resolve package).

It was solved as commented here: