【问题标题】:How to fix "parcel: Permission denied" on Heroku如何在 Heroku 上修复“包裹:权限被拒绝”
【发布时间】:2021-06-03 18:12:34
【问题描述】:

我想在 Heroku 上部署我的应用程序,但它在 Heroku cli 上显示“parcel: Permission denied”错误。我的项目由两个项目组成。

  1. 后端 - 节点、expressjs
  2. 前端 - 反应

项目与concurrently npm packege相关

这是主要的 package.json 文件

{
  "name": "mainPro",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "cd backend && node server.js",
    "server": "cd backend && nodemon server.js",
    "client": "cd frontend && npm run start",
    "dev": "concurrently --kill-others-on-fail \"npm run server\" \"npm run client\""
  },
  "author": "",
  "license": "ISC",
  "engines": {
    "node": "14.15.4",
    "npm": "6.14.10"
  },
  "dependencies": {
    "concurrently": "^6.2.0",
    "nodemon": "^2.0.7"
  }
}

这是前端的 package.json 文件

{
  "name": "FrontendFolder",
  "version": "1.0.0",
  "description": "",
  "main": "index.jsx",
  "scripts": {
    "start": "parcel public/index.html"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@iconscout/react-unicons": "^1.1.6",
    "@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"
  }
}

这是后端的 package.json 文件

{
  "name": "backend",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node server.js",
    "dev": "nodemon server.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "mongoose": "^5.12.5",
    "multer": "^1.4.2",
    "nodemailer": "^6.6.0",
    "nodemailer-sendgrid-transport": "^0.2.0"
  }
}
Heroku CLI logs

【问题讨论】:

    标签: heroku mern heroku-cli parcel parceljs


    【解决方案1】:

    在前端添加build

    "build": "parcel build public/index.html",
    "heroku-postbuild": "parcel build public/index.html"
    

    【讨论】:

    • 我应该删除“start”:“parcel public/index.html”吗?
    • 还是同样的问题
    猜你喜欢
    • 2019-03-15
    • 2019-09-18
    • 2021-10-08
    • 2015-02-02
    • 1970-01-01
    • 1970-01-01
    • 2015-04-15
    • 1970-01-01
    • 2010-12-21
    相关资源
    最近更新 更多