Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

package.json里面哪错了吗?

{
  "name": "test",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.15.2",
    "cookie-parser": "~1.4.3",
    "debug": "~2.2.0",
    "ejs": "~2.5.2",
    "express": "~4.14.0",
    "method-override": "*",
    "mongodb": "^1.4.19",
    "morgan": "~1.7.0",
    "serve-favicon": "~2.3.0"
    "express-session": "*",
    "connect-mongo": "*",
    "connect-flash": "*"
  }
}

这是package.json里面的
下面是报错信息:

error Windows_NT 10.0.14393
14 error argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
15 error node v6.9.5
16 error npm  v3.10.10
17 error file F:wwwlogestpackage.json
18 error code EJSONPARSE
19 error Failed to parse json
19 error Unexpected token 'e' at 18:6
19 error     "express-session": "*",
19 error      ^
20 error File: F:wwwlogestpackage.json
21 error Failed to parse package.json data.
21 error package.json must be actual JSON, not just JavaScript.
21 error
21 error This is not a bug in npm.
21 error Tell the package author to fix their package.json file. JSON.parse
22 verbose exit [ 1, true ]

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

1 Reply

0 votes
by (71.8m points)

"serve-favicon": "~2.3.0" 后面忘记加逗号了。
有语法高亮看一眼就能看出来吧!!!而且还有解释器的提示。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...