Sunday, 6 January 2019

EJSONPARSE error when using `npm install`

When I use npm install I get an error of,npm ERR! file /home/alex/Documents/Programming/test/package.json npm ERR! code EJSONPARSE npm ERR! JSON.parse Failed to parse json npm ERR! JSON.parse Unexpected end of JSON input while parsing near '' npm ERR! JSON.parse Failed to parse package.json data. npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript. npm ERR! A complete log of this run can be found in: npm ERR! /home/alex/.npm/_logs/2019-01-06T08_31_16_342Z-debug.log I have tried using npm cache clean with no luck,deleted package-lock.jsondeleted package.jsonremoved and then reinstalled npm and node.and none of these worked, all the other peoples errors on stackoverflow etc have been fixed by clearing the cache or by a mistake in the package.json.package.json:{ "name": "roast-bot", "description": "A bot to roast people on discord", "version": "1.9.5", "main": "main.js", "scripts": { "start": "node main.js" }, "engines": { "node": "8.11.4", "npm": "5.6.0" }, "dependencies": { "better-sqlite-pool": "0.1.2", "discord.js": "11.4.2", "enmap": "4.2.0", "mysql": "2.16.0", "node": "8.11.4", "node-gyp": "3.8.0", "relevant-urban": "2.0.0", "request": "2.81.0" }, "devDependencies": {}, "repository": { "type": "git", "url": "git+http://bit.ly/2SFUxyo" }, "keywords": [ "discord" ], "author": "Ole113", "license": "MIT", "bugs": { "url": "http://bit.ly/2AzNNez" }, "homepage": "http://bit.ly/2SEDxsy" }The debug log is as follows,0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ] 2 info using npm@6.5.0-next.0 3 info using node@v11.6.0 4 verbose npm-session 425fde4e367af730 5 silly install runPreinstallTopLevelLifecycles 6 silly install loadCurrentTree 7 silly install readLocalPackageData 8 timing stage:rollbackFailedOptional Completed in 3ms 9 timing stage:runTopLevelLifecycles Completed in 40ms 10 verbose stack Error: Failed to parse json 10 verbose stack Unexpected end of JSON input while parsing near '' 10 verbose stack at parseError (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:452:11) 10 verbose stack at parseJson (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:104:26) 10 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:51:5 10 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:90:16 10 verbose stack at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3) 11 verbose cwd /home/alex/Documents/Programming/test 12 verbose Linux 4.15.0-43-generic 13 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" 14 verbose node v11.6.0 15 verbose npm v6.5.0-next.0 16 error file /home/alex/Documents/Programming/test/package.json 17 error code EJSONPARSE 18 error JSON.parse Failed to parse json 18 error JSON.parse Unexpected end of JSON input while parsing near '' 19 error JSON.parse Failed to parse package.json data. 19 error JSON.parse package.json must be actual JSON, not just JavaScript. 20 verbose exit [ 1, true ] Any help would be awesome, thanks in advance.

Submitted January 06, 2019 at 08:41AM by Ole113

No comments:

Post a Comment