无法将MERN部署到heroku

时间:2019-02-02 21:38:48

标签: reactjs heroku mern

我有我的部署应用程序MERN向Heroku的一个问题,过程zhcon失败反应脚本,我使用相同的配置和postbuild脚本之前已经部署了2个应用程序,也有一个应用程序,我没有之前部署问题,尝试将其再次部署到heroku上的新应用程序中只是为了测试,但失败了。

顺便说一句,我在Windows 10 64x上,节点10.15.1,npm 6.4.1

  {
  "name": "recipury",
  "version": "1.0.0",
  "description": "app to add food recipes",
  "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": "abed taki",
 "license": "MIT",
"dependencies": {
 "bcryptjs": "^2.4.3",
 "body-parser": "^1.18.3",
 "concurrently": "^4.1.0",
 "express": "^4.16.4",
 "jsonwebtoken": "^8.4.0",
 "mongoose": "^5.4.4",
 "multer": "^1.4.1",
 "passport": "^0.4.0",
 "passport-jwt": "^4.0.0",
 "validator": "^10.10.0"
 },
"devDependencies": {
 "nodemon": "^1.18.9"
 },
 "engines": {
  "node": "10.15.1",
  "npm": "6.4.1"
  }
 }

1 个答案:

答案 0 :(得分:0)

如果您在server.js中使用错误处理,则尝试在调用错误之前移动app.use(express.static(path.join(__dirname, 'client/buil')));