Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
106 views
in Technique[技术] by (71.8m points)

javascript - I can't install Parcel using npm - Failed to parse package.json data

I created package.json file using (npm init) in cmd in project folder ,then i wrote (npm i parcel --save-dev) and this what i got :

C:UsersXPRESSDesktopstarter>npm i parcel --save-dev
npm ERR! code EJSONPARSE
npm ERR! file C:UsersXPRESSDesktopstarterpackage.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token } in JSON at position 211 while parsing nea
r '...dex.html",
npm ERR! JSON.parse
npm ERR! JSON.parse   },
npm ERR! JSON.parse   "author": "Ibra...'
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!     C:UsersXPRESSAppDataRoaming
pm-cache\_logs2021-01-25T18_59_41
_237Z-debug.log

and this package.json

{
  "name": "starter",
  "version": "1.0.0",
  "description": "Recipe application",
  "main": "index.html",
  
    "scripts": {
    "start": "parcel index.html",
    "build": "parcel build index.html",
      
  },
  "author": "",
  "license": "ISC"
}

please any ideas .. I'm new and i can't find any solutions for 4 days

question from:https://stackoverflow.com/questions/65890880/i-cant-install-parcel-using-npm-failed-to-parse-package-json-data

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Just remove extra trailing comma at this line:

"build": "parcel build index.html"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...