【问题标题】:Something wrong with my heroku deployment我的 Heroku 部署有问题
【发布时间】:2018-12-12 16:51:18
【问题描述】:
`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"
  }
}

【问题讨论】:

  • 你的build 命令是什么样子的?
  • @AnonymousSB 已编辑帖子!
  • 你从你的 heroku-postbuild 脚本调用 npm run build ,但你实际上没有构建脚本,这似乎是个问题。
  • 不客气,很高兴我能提供帮助

标签: node.js reactjs git express heroku


【解决方案1】:

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

"build": "react-scripts build"

来自 create-react-app package.json

【讨论】:

    猜你喜欢
    • 2020-07-13
    • 2015-06-05
    • 2016-05-11
    • 2017-05-04
    • 2013-06-17
    • 2023-04-10
    • 2021-02-28
    • 2020-05-12
    相关资源
    最近更新 更多