[Solved] Unable to run after update to 1.6.1 on ubuntu 16.04

Hi,

I have updated my app to 1.6.1 and afterward was unable to start it.
I then removed my .meteor directory and did:
curl https://install.meteor.com/ | sh
I then created a fresh version of my app with:
meteor create --bare myappname

Then installed npm packages
meteor npm install --save jszip bufferutil utf-8-validate
meteor npm install --save uniforms-bootstrap4 simpl-schema react-fontawesome filesaver.js react-loadable react-plotly.js keymaster
meteor npm install --save mqtt flat ogr2ogr stripe body-parser uniforms bcrypt
meteor add http email meteorhacks:picker alanning:roles aldeed:collection2-core mdg:validated-method accounts-password
meteor remove autopublish insecure
meteor npm install --save-dev babel-eslint eslint-config-airbnb eslint-plugin-import eslint-plugin-meteor eslint-plugin-react eslint-plugin-jsx-a11y eslint-import-resolver-meteor eslint @meteorjs/eslint-config-meteor

meteor reset
npm run start

I get the error below, which is cryptic for me. Any advice?

george@george-VirtualBox:~/Desktop/h2io/h2iot5$ meteor reset
Project reset.                                
george@george-VirtualBox:~/Desktop/h2io/h2iot5$ npm run start

> h2iot5@ start /home/george/Desktop/h2io/h2iot5
> meteor --settings settings-development.json

[[[[[ ~/Desktop/h2io/h2iot5 ]]]]]             

=> Started proxy.                             
/home/george/.meteor/packages/static-html/.1.2.2.h7t2n1.wjogo++os+web.browser+web.cordova/plugin.compileStaticHtmlBatch.os/npm/node_modules/meteor/promise/node_modules/meteor-promise/promise_server.js:190
      throw error;
      ^

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Object..json (/tools/isobuild/import-scanner.js:65:26)
    at ImportScanner._readModule (/tools/isobuild/import-scanner.js:879:53)
    at each (/tools/isobuild/import-scanner.js:775:22)
    at _.each._.forEach (/home/george/.meteor/packages/meteor-tool/.1.6.1_1.c76v6p.io9tw++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:719:5)
    at each (/tools/isobuild/import-scanner.js:759:14)
    at _.each._.forEach (/home/george/.meteor/packages/meteor-tool/.1.6.1_1.c76v6p.io9tw++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:719:5)
    at each (/tools/isobuild/import-scanner.js:759:14)
    at _.each._.forEach (/home/george/.meteor/packages/meteor-tool/.1.6.1_1.c76v6p.io9tw++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:719:5)
    at each (/tools/isobuild/import-scanner.js:759:14)
    at _.each._.forEach (/home/george/.meteor/packages/meteor-tool/.1.6.1_1.c76v6p.io9tw++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:87:22)
    at ImportScanner._scanFile (/tools/isobuild/import-scanner.js:719:5)
    at outputFiles.forEach.file (/tools/isobuild/import-scanner.js:414:14)
    at Array.forEach (<anonymous>)
    at ImportScanner.scanImports (/tools/isobuild/import-scanner.js:412:22)
    at sourceBatches.forEach.batch (/tools/isobuild/compiler-plugin.js:1045:17)
    at Array.forEach (<anonymous>)
    at Function.computeJsOutputFilesMap (/tools/isobuild/compiler-plugin.js:1013:19)
    at ServerTarget._emitResources (/tools/isobuild/bundler.js:1057:8)
    at buildmessage.enterJob (/tools/isobuild/bundler.js:828:12)
    at /tools/utils/buildmessage.js:359:18
    at exports.EnvironmentVariable.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:352:34
    at exports.EnvironmentVariable.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:350:23
    at exports.EnvironmentVariable.withValue (/tools/utils/fiber-helpers.js:89:14)
    at Object.enterJob (/tools/utils/buildmessage.js:324:26)
    at ServerTarget.make (/tools/isobuild/bundler.js:819:18)
    at /tools/isobuild/bundler.js:2957:14
    at /tools/isobuild/bundler.js:3025:20
    at /tools/utils/buildmessage.js:271:13
    at exports.EnvironmentVariable.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:264:29
    at exports.EnvironmentVariable.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:262:18
    at exports.EnvironmentVariable.withValue (/tools/utils/fiber-helpers.js:89:14)
    at /tools/utils/buildmessage.js:253:23
    at exports.EnvironmentVariable.withValue (/tools/utils/fiber-helpers.js:89:14)
    at Object.capture (/tools/utils/buildmessage.js:252:19)
    at bundle (/tools/isobuild/bundler.js:2910:31)
    at files.withCache (/tools/isobuild/bundler.js:2857:32)
    at Object.withCache (/tools/fs/files.js:1664:12)
    at Object.exports.bundle (/tools/isobuild/bundler.js:2857:16)
    at Profile.run (/tools/runners/run-app.js:579:36)
    at Function.run (/tools/tool-env/profile.js:490:12)
    at bundleApp (/tools/runners/run-app.js:578:34)
    at AppRunner._runOnce (/tools/runners/run-app.js:622:35)
    at AppRunner._fiber (/tools/runners/run-app.js:880:28)
    at /tools/runners/run-app.js:408:12

npm ERR! Linux 4.4.0-116-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "start"
npm ERR! node v6.14.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! h2iot5@ start: `meteor --settings settings-development.json`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the h2iot5@ start script 'meteor --settings settings-development.json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the h2iot5 package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     meteor --settings settings-development.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs h2iot5
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls h2iot5
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/george/Desktop/h2io/h2iot5/npm-debug.log


SyntaxError: Unexpected end of JSON input

Looks like an error in your settings-development.json
Try making a simplified json to test with

I have placed my settings-development.json, as well as package.json in JSONLint.com
Both pass as valid json and still I get the same error.

Then I stripped down my settings-development.json to this:

{
  "public": {
  },
  "private": {
  }
}

and my package.json to this

{
  "name": "h2iot5",
  "private": true,
  "scripts": {
    "start": "meteor --settings settings-development.json",
    "lint": "eslint .",
    "pretest": "npm run lint --silent"
  },
  "eslintConfig": {
    "extends": "@meteorjs/eslint-config-meteor",
    "globals": {
      "classNames": true,
      "PropTypes": true,
      "React": true,
      "Immutable": true,
      "L": true,
      "Reactstrap": true,
      "ReactRouterDOM": true,
      "ReactLeaflet": true,
      "moment": true,
      "Plotly": true,
      "Gauge": true,
      "Datetime": true
    },
    "rules": {
      "jsx-quotes": [
        "error",
        "prefer-single"
      ]
    }
  },
  "dependencies": {
    "@babel/runtime": "^7.0.0-beta.42",
    "bcrypt": "^1.0.3",
    "body-parser": "^1.18.2",
    "bufferutil": "^3.0.3",
    "filesaver.js": "^1.3.4",
    "flat": "^4.0.0",
    "jszip": "^3.1.5",
    "keymaster": "^1.6.2",
    "meteor-node-stubs": "^0.3.2",
    "react-fontawesome": "^1.6.1",
    "react-loadable": "^5.3.1",
    "react-plotly.js": "^2.1.0",
    "simpl-schema": "^1.4.2",
    "stripe": "^5.8.0",
    "uniforms": "^1.23.2",
    "uniforms-bootstrap4": "^1.23.2",
    "utf-8-validate": "^4.0.0"
  },
  "devDependencies": {
    "@meteorjs/eslint-config-meteor": "^1.0.5",
    "babel-eslint": "^8.2.2",
    "eslint": "^4.19.1",
    "eslint-config-airbnb": "^16.1.0",
    "eslint-import-resolver-meteor": "^0.4.0",
    "eslint-plugin-import": "^2.10.0",
    "eslint-plugin-jsx-a11y": "^6.0.3",
    "eslint-plugin-meteor": "^4.2.0",
    "eslint-plugin-react": "^7.7.0"
  }
}

and it still fails

The problem was that I had an empty .json file in my imports folder.
By adding {} into the file it works again!

Perhaps meteor/node could say which .json file it has problem with parsing, to make debuggin easier?

Thanks

2 Likes

THANK YOU. this was exactly my problem. malformed json file in /imports