尝试键入“节点启动” MEAN堆栈时出错

时间:2019-01-30 21:13:59

标签: node.js stack mean

我正在尝试学习MEAN堆栈,并且在键入node start时遇到此错误

     npm ERR! code EJSONPARSE
    npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected string in JSON at position 489 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文件,并且没有使用npm init和npm install NAMES --save触摸过。我有一个app.js文件,可以将端口设置为3000,并将变量设置为我安装的必需软件包

  {
  "name": "meanauthapp",
  "version": "1.0.0",
  "description": "meanauthapp",
  "main": "app.js",
  "dependencies": {
    "bcryptjs": "^2.4.3",
    "body-parser": "^1.18.3",
    "cors": "^2.8.5",
    "ejs": "^2.6.1",
    "express": "^4.16.4",
    "jsonwebtoken": "^8.4.0",
    "mongojs": "^2.6.0",
    "mongoose": "^5.4.8",
    "passport": "^0.4.0",
    "passport-jwt": "^4.0.0"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
    "start": "node app"
  },
  "author": "",
   "license": "ISC"
}

不确定输入错误的原因,谢谢!

1 个答案:

答案 0 :(得分:1)

您缺少逗号,因此无法解析无效的JSON。将您的脚本属性更新为:

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node app"
  },