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.

stack SyntaxError: Unexpected string in JSON at position 493

See original GitHub issue

(This issue tracker is only for bug reports or feature requests, if this is neither, please choose appropriate channel from http://bluebirdjs.com/docs/support.html)

Please answer the questions the best you can:

  1. What version of bluebird is the issue happening on? Not sure because it’s not showing up in npm list

  2. What platform and version? (For example Node.js 0.12 or Google Chrome 32) node v9.5.0

  3. Did this issue happen with earlier version of bluebird? I’ve never explicitly used bluebird, I believe it was installed as a dependency for Babel on my system. There seems to be an error in the bluebird module which is preventing my npm install from working. Error:

14 verbose stack SyntaxError: Unexpected string in JSON at position 493
14 verbose stack     at JSON.parse (<anonymous>)
14 verbose stack     at module.exports (/usr/local/lib/node_modules/npm/lib/utils/parse-json.js:3:15)
14 verbose stack     at BB.join (/usr/local/lib/node_modules/npm/lib/install/read-shrinkwrap.js:31:20)
14 verbose stack     at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
14 verbose stack     at Holder$3._callFunction (eval at generateHolderClass (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:14:44)
14 verbose stack     at Holder$3.checkFulfillment (eval at generateHolderClass (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:92:16), <anonymous>:29:30)
14 verbose stack     at Promise.eval (eval at thenCallback (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/join.js:14:16), <anonymous>:6:20)
14 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:566:21)
14 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
14 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
14 verbose stack     at Promise._fulfill (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
14 verbose stack     at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:582:21)
14 verbose stack     at Promise._settlePromise0 (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
14 verbose stack     at Promise._settlePromises (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
14 verbose stack     at Promise._fulfill (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
14 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/nodeback.js:42:21
15 verbose cwd <app-path>
16 verbose Darwin 17.3.0
17 verbose argv "/usr/local/Cellar/node/9.5.0/bin/node" "/usr/local/bin/npm" "install"
18 verbose node v9.5.0
19 verbose npm  v5.6.0
20 error Unexpected string in JSON at position 493
21 verbose exit [ 1, true ]

I can’t just fix this issue on my local as I don’t upload my node_modules on Github and this error doesn’t seem to be coming up on any other system

Issue Analytics

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

github_iconTop GitHub Comments

17reactions
isochronouscommented, Feb 7, 2018

Yeah, I just figured out that this was due to an invalid package-lock.json file. I deleted said file and re-ran npm install and now everything is working as expected.

3reactions
benjamingrcommented, Feb 7, 2018

You have invalid JSON somewhere - this isn’t related to bluebird and is a bug in some library using bluebird. You can see which in the node-modules (looks like read-shrinkwrap in NPM?).

Bluebird might be able to help you further if you turn on the environment flag for long stack traces.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SyntaxError: Unexpected string in JSON at position 49
Its mean your request contains an invalid try to parse it with this online tool to find the problem. enter link description here....
Read more >
syntaxerror: unexpected string in json at position - You.com
There are two common causes for this. The first is that you may be referencing a non-existent property (or even a non-existent variable...
Read more >
fixing SyntaxError: Unexpected string/token in JSON at position
Use Javascript's built-in JSON. stringify() function, or libraries in other languages, to create JSON strings from real objects.
Read more >
How To Fix Unexpected token u in JSON at position 0 - Isotropic
This error is caused when you are attempting to parse a non-existent property. Typically, this is due to a misspelling, or simply referencing ......
Read more >
Condition builder with date fields not working on list and ...
VM1170:1 Uncaught SyntaxError: Unexpected string in JSON at position 721 at JSON.parse (<anonymous>) ... On the session debug log, observed below stack,
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