我正在尝试将MERN堆栈部署到Heroku,但是当我尝试'git push heroku master'时说“ sh:1:cd:无法cd到../react-front”时出现错误。 我的文件夹“ app”有两个文件夹:“ node-api”和“ react-front”。在node-api的package.json文件中,行“ heroku-postbuild”:“ cd ../react-front && npm install && npm run build” 这给出了这个错误。我该如何解决?
答案 0 :(得分:0)
尝试:npm run deploy:full
"scripts": {
"build:ui": "cd ../react-front && npm install && npm run build",
"deploy": "git push heroku master",
"deploy:full": "npm run build:ui && git add . && git commit -m uibuild && npm run deploy"
}
请勿更改heroku默认的build
命令