我正在尝试使用GIT Heroku部署我的heroku应用。我只更新了一个文件。该应用程序在构建时于2018年10月顺利部署。以下是错误消息和package.JSON文件。显然我的package.JSON文件的第15行引起了错误。这行代码是否过时了?
15: "heroku-postbuild": "NPM_CONFIG_PRODUCTION-false npm install --prefix client && npm run build --prefix client && npm run build --prefix client"
错误:
± git push heroku master
Counting objects: 45, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (45/45), done.
Writing objects: 100% (45/45), 5.34 KiB | 1.78 MiB/s, done.
Total 45 (delta 35), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: parse error: Expected another key-value pair at line 15, column 3
remote: ! Unable to parse package.json
remote:
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to project.
remote:
To https://git.heroku.com/project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/project.git
服务器Package.JSON
{
"name": "reactexpress",
"version": "1.0.0",
"description": "boilerplate for React, Express, Mongo",
"main": "server.js",
"engines": {
"node": "8.1.1",
"npm": "5.0.3"
},
"scripts": {
"start": "node server.js",
"server": "nodemon server.js",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION-false npm install --prefix client && npm run build --prefix client && npm run build --prefix client"
},
"license": "ISC",
"dependencies": {
"@sendgrid/mail": "^6.3.1",
"body-parser": "^1.18.3",
"concurrently": "^4.0.1",
"express": "^4.16.3",
"express-validator": "^5.3.0",
"mongoose": "^5.2.17",
"sendgrid": "^5.2.3"
},
"devDependencies": {
"nodemon": "^1.18.4"
}
}
Client Package.JSON
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.18.0",
"node-sass-chokidar": "^1.3.3",
"npm-run-all": "^4.1.3",
"react": "^16.5.2",
"react-dom": "^16.5.2",
"react-modal": "^3.6.1",
"react-router": "^4.3.1",
"react-router-dom": "^4.3.1",
"react-scripts": "^1.1.5",
"react-transition-group": "^2.4.0"
},
"scripts": {
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build-js": "react-scripts build",
"build": "npm-run-all build-css build-js",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"proxy": "http://localhost:5000"
}