问题描述
我想在使用 MERN 创建的 Heroku 上部署网站。我用包裹创建了它。当我在 Heroku 上部署时,它显示以下错误,我无法在 heroku 上部署它。 我该如何解决这个问题? Error Image
Package.json
{
"name": "TestProject","version": "1.0.0","description": "","main": "index.jsx","scripts": {
"start": "parcel public/index.html"
},"keywords": [],"author": "","license": "ISC","dependencies": {
"@material-ui/core": "^4.11.3","axios": "^0.21.1","dropzone": "^5.9.2","parcel": "^2.0.0-beta.2","react": "^17.0.2","react-bootstrap": "^1.5.2","react-dom": "^17.0.2","react-router-dom": "^5.2.0"
},"devDependencies": {
"@parcel/transformer-image": "^2.0.0-beta.2","react-dropzone": "^11.3.2"
}
}
解决方法
Heroku 会在那里寻找用于生产的构建命令。
"scripts": {
"build": "npm run build","install": "npm install","start": "....",},