我的heroku部署出了点问题

时间:2018-12-08 04:01:19

标签: node.js reactjs git express heroku

`NPM_CONFIG_PRODUCTION=false npm install --prefix client &&  npm run build --prefix client`
remote: npm ERR! Exit status 254
remote: npm ERR! 
remote: npm ERR! Failed at the walking-bucket@1.0.0 heroku-postbuild script.

这是我尝试将express / React应用程序部署到heroku时遇到的错误,有什么想法吗?

编辑:带有构建脚本的package.json:

{
  "name": "walking-bucket",
  "version": "1.0.0",
  "description": "basketball shot journal log",
  "main": "server.js",
  "scripts": {
    "client-install": "npm install --prefix client",
    "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"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "bcrypt": "^3.0.2",
    "bcrypt-nodejs": "0.0.3",
    "body-parser": "^1.18.3",
    "concurrently": "^4.1.0",
    "express": "^4.16.4",
    "express-session": "^1.15.6",
    "mongoose": "^5.3.14",
    "passport": "^0.4.0",
    "passport-local": "^1.0.0",
    "passport-local-mongoose": "^5.0.1"
  },
  "devDependencies": {
    "nodemon": "^1.18.7"
  }
}

1 个答案:

答案 0 :(得分:0)

使用build命令获得我的解决方案

"build": "react-scripts build"

来自create-react-app package.json