简体   繁体   English

Heroku 部署:JSON 解析错误 package.Z466DEEC76ECDF5FCA654D8571F6Z2 有效

[英]Heroku deployment: JSON parse error in package.json despite being valid

I am trying to deploy a mern app, but I get the following error, despite checking my package.json file myself and in multiple websites, what could be the issue here please?我正在尝试部署一个 mern 应用程序,但我收到以下错误,尽管我自己和多个网站检查了我的 package.json 文件,请问这里有什么问题?


> Compressing source files... done.
Building source:

-----> Node.js app detected
parse error: Expected another key-value pair at line 12, column 3
 !     Unable to parse package.json


-----> Build failed

We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys

If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/

Love,
Heroku

HERE IS MY PACKAGE.JSON FILE这是我的 PACKAGE.JSON 文件

{
  "name": "backend",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index",
    "dev": "nodemon index",
    "build": "cd client && npm run build",
    "install-client": "cd client && npm install",
    "heroku-postbuild": "npm run install-client && npm run build"
  },
  "keywords": ["books"],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@hapi/joi": "^17.1.1",
    "bcrypt": "^5.0.0",
    "cors": "^2.8.5",
    "express": "^4.17.1",
    "jsonwebtoken": "^8.5.1",
    "mongoose": "^5.9.18"
  },
  "devDependencies": {
    "nodemon": "^2.0.4"
  }
}

try this尝试这个

{
    "name": "backend",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "scripts": {
      "start": "node index",
      "build": "cd client && npm run build",
      "install-client": "cd client && npm install",
      "heroku-postbuild": "npm run install-client && npm run build"
    },
    "keywords": ["books"],
    "author": "",
    "license": "ISC",
    "dependencies": {
      "@hapi/joi": "^17.1.1",
      "bcrypt": "^5.0.0",
      "cors": "^2.8.5",
      "express": "^4.17.1",
      "jsonwebtoken": "^8.5.1",
      "mongoose": "^5.9.18"
    }
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM