Error in starting the lite-server using NPM

Issue

npm ERR! code EJSONPARSE

npm ERR! file C:\Users\thehitmanranjan\Desktop\git-test\package.json

npm ERR! JSON.parse Failed to parse json

npm ERR! JSON.parse Unexpected string in JSON at position 240 while
parsing ‘{

npm ERR! JSON.parse “name”: “git-test”,

npm ERR! JSON.parse “version”: “1.’

npm ERR! JSON.parse Failed to parse package.json data.

npm ERR! JSON.parse package.json must be actual JSON, not just
JavaScript.

This is the error I get when I give command “npm start”.
My package.JSON file has the following contents:

{

"name": "git-test",

"version": "1.0.0",

"description": "\"This is a test directory to learn Git and Node\"",

"main": "index.html",

"scripts": {

"start":"npm run lite",

"test": "echo \"Error: no test specified\" && exit 1"

"lite":"lite-server"

},

"repository": {

"type": "git",

"url": "git+https://github.com/thehitmanranjan/git-test.git"

},

"author": "Pratik Ranjan",

"license": "ISC",

"bugs": {

"url": "https://github.com/thehitmanranjan/git-test/issues"

},

"homepage": "https://github.com/thehitmanranjan/git-test#readme",

"devDependencies": {

"lite-server": "^2.5.4"

}

}

Solution

There is a comma missing after this line "test": "echo \"Error: no test specified\" && exit 1"

Answered By – Ashish Modi

Answer Checked By – Mary Flores (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.