package.json错误

时间:2018-07-25 06:58:43

标签: json mean package.json

我在我的mean.js应用程序的根目录中运行“ npm build”和“ npm start”,但是遇到以下错误:

npm ERR! file /Users/developer/dev-projects/everest-web/package.json
npm ERR! code EJSONPARSE
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 162 while parsing
'{
npm ERR! JSON.parse   "name": "meanauthapp",
npm ERR! JSON.parse   "version": '

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

这是我的package.json文件:

{
"name": "meanauthapp",
"version": "1.0.0",
"description": "MEAN stack authentication app",
"main": "app.js",
"scripts": {
"start": "node app"
"ng": "ng"
},
"dependencies": {
"express": "4.16.2",
"mongoose": "4.13.6",
"bcryptjs": "2.4.3",
"cors": "2.8.4",
"jsonwebtoken": "8.1.0",
"body-parser": "1.18.2",
"passport": "0.4.0",
"passport-jwt": "3.0.1"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@angular/cli": "^1.6.0"
}
}

2 个答案:

答案 0 :(得分:1)

“开始”后没有逗号:“节点应用”

答案 1 :(得分:0)

检查“无法解析JSON”错误的最简单方法是将文件内容粘贴到验证器中。

我推荐:

https://jsonlint.com/

按“验证JSON”,第7行中缺少的逗号将突出显示。