簡體   English   中英

無法在 heroku 上部署應用程序

[英]Unable to deploy application on heroku

我在 heroku 上部署我的應用程序時收到以下錯誤,我之前已經部署過它,沒有任何問題。 我也沒有更改 package.json 文件,所以我不確定為什么會出現以下錯誤。

heroku 沒有額外的配置,應用程序之前已部署,無法更新。

該應用程序目前通過我的 github 上的 heroku 網站部署在以前的版本下。

任何解決此問題的幫助將不勝感激!

來自heroku的錯誤

-----> Build

       Running heroku-postbuild



       > operations-reporting@1.0.0 heroku-postbuild /tmp/build_04594e22478b41fb98f830b9b12c2400

       > NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client



       added 86 packages from 287 contributors and audited 906755 packages in 16.658s

       found 2 moderate severity vulnerabilities

         run `npm audit fix` to fix them, or `npm audit` for details



       > client@0.1.0 build /tmp/build_04594e22478b41fb98f830b9b12c2400/client

       > react-scripts build



internal/modules/cjs/loader.js:800

    throw err;

    ^

Error: Cannot find module 'es-abstract/2019/CreateDataProperty'

Require stack:

- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js

- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js

- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js

- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js

- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js

- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js

- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)

    at Function.Module._load (internal/modules/cjs/loader.js:690:27)

    at Module.require (internal/modules/cjs/loader.js:852:19)

    at require (internal/modules/cjs/helpers.js:74:18)

    at Object.<anonymous> (/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js:3:26)

    at Module._compile (internal/modules/cjs/loader.js:959:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)

    at Module.load (internal/modules/cjs/loader.js:815:32)

    at Function.Module._load (internal/modules/cjs/loader.js:727:14)

    at Module.require (internal/modules/cjs/loader.js:852:19) {

  code: 'MODULE_NOT_FOUND',

  requireStack: [

    '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js',

    '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js',

    '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js',

    '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js',

    '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js',

    '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js',

    '/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js'

  ]

}

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! client@0.1.0 build: `react-scripts build`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the client@0.1.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR!     /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_533Z-debug.log

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! operations-reporting@1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the operations-reporting@1.0.0 heroku-postbuild script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

npm ERR!     /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_547Z-debug.log

-----> Build failed



       We're sorry this build is failing! You can troubleshoot common issues here:

       https://devcenter.heroku.com/articles/troubleshooting-node-deploys



       Some possible problems:



       - node_modules checked into source control

         https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits



       - Node version not specified in package.json

         https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version



       Love,

       Heroku



 !     Push rejected, failed to compile Node.js app.

 !     Push failed


包.json

{
  "name": "client",
  "version": "0.1.0",
  "main": "index.js",
  "private": true,
  "dependencies": {
    "axios": "^0.19.0",
    "config": "^3.2.4",
    "express": "^4.17.1",
    "express-validator": "^6.3.0",
    "formik": "^2.0.6",
    "mongoose": "^5.7.12",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-router-dom": "^5.1.2",
    "react-scripts": "3.2.0",
    "react-table": "^6.10.3",
    "reactstrap": "^8.1.1",
    "schema-utils": "^2.6.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "concurrently": "^5.0.0",
    "nodemon": "^2.0.1"
  },
  "proxy": "http://localhost:5000"
}

找到丟失的模塊並像這樣更新你的包:

npm install --save --save-exact foo@1.2.3

這是來自heroku

其他解決方案

heroku config:set NODE_MODULES_CACHE=false

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM