首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >package.json出错

package.json出错
EN

Stack Overflow用户
提问于 2018-07-25 14:58:43
回答 2查看 846关注 0票数 0

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

代码语言:javascript
复制
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文件:

代码语言:javascript
复制
{
"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"
}
}
EN

回答 2

Stack Overflow用户

发布于 2018-07-25 15:03:47

“start”后没有逗号:"node app“

票数 2
EN

Stack Overflow用户

发布于 2019-03-12 20:07:16

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

我建议:

https://jsonlint.com/

按"Validate“,第7行中缺少的逗号会清晰地突出显示。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51512644

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档