TryGhost / gscan

Ghost theme scanner - checks for errors and feature support
https://gscan.ghost.org
MIT License
75 stars 55 forks source link

Unexpected string in JSON at position 159 #376

Closed diazepan closed 3 years ago

diazepan commented 3 years ago

When I tried to update from the 3.42.2 version to the 4.0.1 version, I get this error

Stack: SyntaxError: Unexpected string in JSON at position 159 at JSON.parse () at checkUsage (/var/www/ghost/versions/4.0.1/node_modules/gscan/lib/checks/080-helper-usage.js:12:38) at /var/www/ghost/versions/4.0.1/node_modules/gscan/lib/checker.js:34:24 at tryCatcher (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/util.js:16:23) at Object.gotValue (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/reduce.js:168:18) at Object.gotAccum (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/reduce.js:155:25) at Object.tryCatcher (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/var/www/ghost/versions/4.0.1/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (internal/timers.js:461:21)

naz commented 3 years ago

@diazepan what's the contents of your theme's package.json file? It seems like the file is not there or the JSON formatting in the file is broken.

diazepan commented 3 years ago

{ "name": "attila", "description": "Ghost Theme", "demo": "http://attila.zutrinken.com", "version": "1.7.6", "engines": { "ghost": ">=3.0.0" "ghost-api": "v3" }, "license": "MIT", "screenshots": { "desktop": "src/screenshot-desktop.jpg", "mobile": "src/screenshot-mobile.jpg" }, "author": { "name": "Peter Amende", "email": "xoxo@zutrinken.com", "url": "http://zutrinken.com" }, "gpm": { "type": "theme", "categories": [ "Minimal", "Personal Blogs" ] }, "keywords": [ "ghost-theme", "ghost", "theme" ], "repository": { "type": "git", "url": "https://github.com/zutrinken/attila.git" }, "devDependencies": { "autoprefixer": "^9.1.5", "grunt": "^1.0.1", "grunt-contrib-clean": "^1.1.0", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-uglify": "^3.3.0", "grunt-contrib-watch": "^1.0.0", "grunt-postcss": "^0.9.0", "grunt-sass": "^2.1.0", "grunt-zip": "^0.18.1", "load-grunt-tasks": "^3.5.2" }, "config": { "posts_per_page": 10 } }

The "ghost-api": "v3" line, I added it recently

naz commented 3 years ago

There's a missing comma , after "ghost": ">=3.0.0" entry.

diazepan commented 3 years ago

thanks, now I'll correct the rest of the errors with the gscan