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:
-
What version of bluebird is the issue happening on? Not sure because it’s not showing up in
npm list
-
What platform and version? (For example Node.js 0.12 or Google Chrome 32)
node v9.5.0
-
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 mynpm 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:
- Created 6 years ago
- Comments:6
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.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.