Express: al querer hacer ( npm install grunt --save-dev) me sale error

Created on 28 Jul 2020  路  2Comments  路  Source: expressjs/express

**npm ERR! code EJSONPARSE
npm ERR! file C:\Users\Joseph_ViL\documents\guia-curso1\package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected token } in JSON at position 778 while parsing near '...npm run usemin",
npm ERR! JSON.parse },
npm ERR! JSON.parse "repository": ...'
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:\Users\Joseph_ViL\AppData\Roaming\npm-cache_logs\2020-07-28T00_17_58_459Z-debug.log
**

question

Most helpful comment

Your package.json contains invalid JSON. That's not a problem with express.
It looks like you have a trailing comma after ...npm run usemin". Try to change it from something like this:

    "sth": "...npm run usemin",
  },
  "repository": "..."

to this (just remove the comma):

    "sth": "...npm run usemin"
  },
  "repository": "..."

Also some editors/IDEs can show you the precise location (and a better explanation) of such errors:
obraz

All 2 comments

Your package.json contains invalid JSON. That's not a problem with express.
It looks like you have a trailing comma after ...npm run usemin". Try to change it from something like this:

    "sth": "...npm run usemin",
  },
  "repository": "..."

to this (just remove the comma):

    "sth": "...npm run usemin"
  },
  "repository": "..."

Also some editors/IDEs can show you the precise location (and a better explanation) of such errors:
obraz

muchas gracias

Was this page helpful?
0 / 5 - 0 ratings