我的heroku部署出了点问题

我的heroku部署出了点问题

本文介绍了我的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 [email protected] heroku-postbuild script.

这是我尝试将express/React应用程序部署到heroku时遇到的错误,任何想法出了什么问题?

This is the error I get when I try to deploy my express/React app to heroku, any ideas what is going wrong?

带有构建脚本的package.json:

edit: package.json with build script:

{
  "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"
  }
}

推荐答案

使用构建命令了解我的解决方案

Got my solution with the build command

"build": "react-scripts build"

来自create-react-app package.json

from the create-react-app package.json

这篇关于我的heroku部署出了点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 01:13