question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SyntaxError: Failed to parse json while running install-app-deps

See original GitHub issue
  • Version: version=20.19.2
  • Target: Windows

install-app-deps errors out with syntax error in json

  • electron-builder version=20.19.2
  • loaded configuration file=package.json ("build" field)
SyntaxError: Unexpected end of JSON input
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at then.it (C:\Users\sandi\Projects\rs-manager\node_modules\electron-builder-lib\src\util\packageDependencies.ts:55:22)
    at tryCatcher (C:\Users\sandi\Projects\rs-manager\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\sandi\Projects\rs-manager\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Users\sandi\Projects\rs-manager\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Users\sandi\Projects\rs-manager\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\sandi\Projects\rs-manager\node_modules\bluebird\js\release\promise.js:693:18)
    at Promise._fulfill (C:\Users\sandi\Projects\rs-manager\node_modules\bluebird\js\release\promise.js:638:18)
    at C:\Users\sandi\Projects\rs-manager\node_modules\bluebird\js\release\nodeback.js:42:21
    at C:\Users\sandi\Projects\rs-manager\node_modules\graceful-fs\graceful-fs.js:78:16
    at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
From previous event:
    at readJson (C:\Users\sandi\Projects\rs-manager\node_modules\electron-builder-lib\src\util\packageDependencies.ts:55:6)
    at C:\Users\sandi\Projects\rs-manager\node_modules\electron-builder-lib\src\util\packageDependencies.ts:224:61
    at Generator.next (<anonymous>)
    at C:\Users\sandi\Projects\rs-manager\node_modules\graceful-fs\polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:159:5)
From previous event:
    at Collector.readChildPackage (C:\Users\sandi\Projects\rs-manager\node_modules\electron-builder-lib\src\util\packageDependencies.ts:206:90)
    at _bluebirdLst.default.map.it (C:\Users\sandi\Projects\rs-manager\node_modules\electron-builder-lib\src\util\packageDependencies.ts:191:69)
From previous event:
    at C:\Users\sandi\Projects\rs-manager\node_modules\electron-builder-lib\src\util\packageDependencies.ts:191:40
    at Generator.next (<anonymous>)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! rs-manager@0.1.0 postinstall: `install-app-deps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the rs-manager@0.1.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

My build section looks like

  "build": {
    "appId": "com.sandi.rsmanager",
    "win": {
     "target": "NSIS"
    }
  },

It’s similar to #2660 but i am on version 20.19.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
dhill2522commented, Jan 21, 2019

I am experiencing a similar problem. I get SyntaxError: Unexpected token < in JSON at position 1121 at JSON.parse (<anonymous>) when running electron-builder.

It appears that <anonymous> is somehow getting pased in pretty early. The bottom of the entire callstack shows at then (<project path here>/node_modules/electron-builder/src/cli/cli.ts:46:19)

1reaction
gimoxcommented, Jan 30, 2019

same error here but with Mac! if my dependencies contains "@angular/pwa": "^0.12.3", (or other versions) i got error SyntaxError: Unexpected token < in JSON at position 1121 at JSON.parse

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to parse json while running install-app-deps ... - GitHub
I am having the following error: • electron-builder ... SyntaxError: Failed to parse json while running install-app-deps #4236.
Read more >
npm "failed to parse json" - Stack Overflow
Mostly, this error is due to a syntax error in package.json file. ... I also got the same error message while run npm...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
SyntaxError : JSON.parse: bad parsing. The JavaScript exceptions thrown by JSON.parse() occur when string failed to be parsed as JSON.
Read more >
Error Failed to parse json-This is not a bug in npm - Edureka
When I'm trying to install express with npm I always get the following error: Failed to parse json No data, empty input at...
Read more >
Error while parsing JSON Response in REST API Post call
I switched to returning a JSON String and then Deserialize the JSON String, it still raises an error "Failed to parse response of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found