【问题标题】:Heroku Error - Timed out running buildpack Node.jsHeroku 错误 - 运行 buildpack Node.js 超时
【发布时间】:2021-07-21 18:39:55
【问题描述】:

我推送到 Heroku 并收到以下错误:

-----> Building on the Heroku-18 stack
-----> Node.js app detected
       
-----> Creating runtime environment
   
   NPM_CONFIG_LOGLEVEL=error
   NODE_ENV=production
   NODE_MODULES_CACHE=true
   NODE_VERBOSE=false
   
-----> Installing binaries

   engines.node (package.json):  14.x
   engines.npm (package.json):   unspecified (use default)
   
   Resolving node version 14.x...
   Downloading and installing node 14.15.4...
   Using default npm version: 6.14.10
   
-----> Restoring cache
   Cached directories were not restored due to a change in version of node, npm, yarn or stack
   Module installation may take longer for this build
   
-----> Installing dependencies
       Installing node modules
   
   > fsevents@1.2.13 install /tmp/build_14df285a/node_modules/webpack-dev-server/node_modules/fsevents
   > node install.js
   
   
   Skipping 'fsevents' build as platform linux is not supported
   
   > fsevents@1.2.13 install /tmp/build_14df285a/node_modules/watchpack-chokidar2/node_modules/fsevents
   > node install.js
   
   
   Skipping 'fsevents' build as platform linux is not supported
   added 1021 packages in 28.668s
   
-----> Build Running build
   
   > foo-bar@0.1.0 build /tmp/build_14df285a
   > webpack --config webpack.prod.js --env.NODE_ENV=prod

 Webpack Bundle Analyzer is started at http://127.0.0.1:8888
       Use Ctrl+C to close it
       Hash: c56aad45799a37467c52
       Version: webpack 4.46.0
       Time: 34310ms
       Built at: 01/26/2021 11:54:18 AM
                Asset       Size  Chunks                    Chunk Names
         ./index.html  250 bytes          [emitted]         
       main.bundle.js   1.26 MiB       0  [emitted]  [big]  main
       Entrypoint main [big] = main.bundle.js
        [21] (webpack)/buildin/global.js 472 bytes {0} [built]
        [55] (webpack)/buildin/module.js 497 bytes {0} [built]
        [69] multi ./node_modules/antd-dayjs-webpack-plugin/src/init-dayjs-webpack-plugin-entry.js ./index.js 40 bytes {0} [built]
        [86] (webpack)/buildin/harmony-module.js 573 bytes {0} [built]
       [237] ./styles/index.scss 560 bytes {0} [built]
       [238] ./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js!./styles/index.scss
6.41 KiB {0} [built]
       [239] ./index.js + 585 modules 1.63 MiB {0} [built]
             | ./index.js 1.06 KiB [built]
             | ./redux/reducers/index.js 243 bytes [built]
             | ./redux/saga/index.js 9.92 KiB [built]
             | ./containers/mangement.js 1.99 KiB [built]
             | ./containers/routes.js 3.67 KiB [built]
             | ./redux/consts.js 1.18 KiB [built]
             | ./redux/reducers/auth.js 5.72 KiB [built]
             | ./redux/reducers/education.js 5.17 KiB [built]
             | ./redux/reducers/management.js 2.33 KiB [built]
             | ./redux/actions/management.js 937 bytes [built]
             | ./redux/actions/auth.js 5.81 KiB [built]
             | ./containers/header.js 6.66 KiB [built]
             | ./containers/home.js 1.03 KiB [built]
             | ./containers/about.js 1.36 KiB [built]
             | ./containers/redirect.js 6.64 KiB [built]
             |     + 571 hidden modules
           + 1740 hidden modules
       
       WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
       This can impact web performance.
       Assets: 
         main.bundle.js (1.26 MiB)
       
       WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
       Entrypoints:
         main (1.26 MiB)
             main.bundle.js
       
       
       WARNING in webpack performance recommendations: 
       You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
       For more info visit https://webpack.js.org/guides/code-splitting/
       Child HtmlWebpackCompiler:
            1 asset
           Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
           [0] ./node_modules/html-webpack-plugin/lib/loader.js!./index.html 293 bytes {0} [built]
-----> Timed out running buildpack Node.js /tmp/codon/tmp/buildpacks/2cd3309e34d34b154aac9f665b0eb2d2e86d8b8e/lib/monitor.sh: line 1: kill: (1293) - No such process  !     Push failed

之前对 Heroku 的推送有效。

我收到超时错误。为什么它说,“没有这样的过程。”我在 Heroku 文档和各种 Google 搜索中找不到这个错误。有谁知道为什么推送失败?我真的很感激。谢谢。

【问题讨论】:

    标签: node.js heroku webpack


    【解决方案1】:

    我安装了 webpack-bundle-analyzer,我猜这导致了问题,因为当我删除它时,heroku 推送成功了。

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题,我的Heroku build 失败了,但看起来问题在于Heroku build command 与我在package.json 中的问题相矛盾

      这就是构建失败时我的package.json 的样子。

      删除该构建脚本后,问题就解决了

      【讨论】:

        猜你喜欢
        • 2018-09-25
        • 1970-01-01
        • 2017-02-15
        • 2017-06-10
        • 1970-01-01
        • 2014-02-04
        • 1970-01-01
        • 2019-04-02
        • 2015-12-25
        相关资源
        最近更新 更多