取消在Heroku上部署MERN应用程序的费用未安装reactHelpers软件包

问题描述

这是我第一次与Heroku合作。我已按照有关如何在Heroku上部署应用程序的说明进行操作。但是我在部署时总是遇到错误。日志文件指出我需要安装ReactHelpers,但是我从来不需要安装此软件包。它还告诉我通过运行以下命令进行安装:npm install ../utils/reactHelpers。但是我无法在我的项目中运行此命令。

错误消息如下:

./node_modules/@material-ui/core/esm/Slider/Slider.js

Cannot find module: '../utils/reactHelpers'. Make sure this package is installed.

这是错误日志:



-----> 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):  unspecified

       engines.npm (package.json):   unspecified (use default)

       

       Resolving node version 12.x...

       Downloading and installing node 12.18.3...

       Using default npm version: 6.14.6

       

-----> Installing dependencies

       Prebuild detected (node_modules already exists)

       Rebuilding any native modules

       [email protected] /tmp/build_6d259321/node_modules/body-parser

       [email protected] /tmp/build_6d259321/node_modules/bytes

       [email protected] /tmp/build_6d259321/node_modules/content-type

       [email protected] /tmp/build_6d259321/node_modules/debug

       [email protected] /tmp/build_6d259321/node_modules/ms

       [email protected] /tmp/build_6d259321/node_modules/depd

       [email protected] /tmp/build_6d259321/node_modules/http-errors

       [email protected] /tmp/build_6d259321/node_modules/inherits

       [email protected] /tmp/build_6d259321/node_modules/setprototypeof

       [email protected] /tmp/build_6d259321/node_modules/statuses

       [email protected] /tmp/build_6d259321/node_modules/toidentifier

       [email protected] /tmp/build_6d259321/node_modules/iconv-lite

       [email protected] /tmp/build_6d259321/node_modules/safer-buffer

       [email protected] /tmp/build_6d259321/node_modules/on-finished

       ee-firs[email protected] /tmp/build_6d259321/node_modules/ee-first

       [email protected] /tmp/build_6d259321/node_modules/qs

       [email protected] /tmp/build_6d259321/node_modules/raw-body

       [email protected] /tmp/build_6d259321/node_modules/unpipe

       [email protected] /tmp/build_6d259321/node_modules/type-is

       [email protected] /tmp/build_6d259321/node_modules/media-typer

       [email protected] /tmp/build_6d259321/node_modules/mime-types

       [email protected] /tmp/build_6d259321/node_modules/mime-db

       [email protected] /tmp/build_6d259321/node_modules/express

       [email protected] /tmp/build_6d259321/node_modules/accepts

       [email protected] /tmp/build_6d259321/node_modules/negotiator

       [email protected] /tmp/build_6d259321/node_modules/array-flatten

       content-dis[email protected] /tmp/build_6d259321/node_modules/content-disposition

       [email protected] /tmp/build_6d259321/node_modules/safe-buffer

       [email protected] /tmp/build_6d259321/node_modules/cookie

       [email protected] /tmp/build_6d259321/node_modules/cookie-signature

       [email protected] /tmp/build_6d259321/node_modules/encodeurl

       [email protected] /tmp/build_6d259321/node_modules/escape-html

       [email protected] /tmp/build_6d259321/node_modules/etag

       [email protected] /tmp/build_6d259321/node_modules/finalhandler

       [email protected] /tmp/build_6d259321/node_modules/parseurl

       [email protected] /tmp/build_6d259321/node_modules/fresh

       [email protected] /tmp/build_6d259321/node_modules/merge-descriptors

       [email protected] /tmp/build_6d259321/node_modules/methods

       [email protected] /tmp/build_6d259321/node_modules/path-to-regexp

       [email protected] /tmp/build_6d259321/node_modules/proxy-addr

       [email protected] /tmp/build_6d259321/node_modules/forwarded

       [email protected] /tmp/build_6d259321/node_modules/ipaddr.js

       [email protected] /tmp/build_6d259321/node_modules/range-parser

       [email protected] /tmp/build_6d259321/node_modules/send

       [email protected] /tmp/build_6d259321/node_modules/destroy

       [email protected] /tmp/build_6d259321/node_modules/mime

       [email protected] /tmp/build_6d259321/node_modules/send/node_modules/ms

       [email protected] /tmp/build_6d259321/node_modules/serve-static

       [email protected] /tmp/build_6d259321/node_modules/utils-merge

       vary@1.1.2 /tmp/build_6d259321/node_modules/vary

       [email protected] /tmp/build_6d259321/node_modules/mongoose

       [email protected] /tmp/build_6d259321/node_modules/bson

       [email protected] /tmp/build_6d259321/node_modules/kareem

       [email protected] /tmp/build_6d259321/node_modules/mongodb

       [email protected] /tmp/build_6d259321/node_modules/bl

       [email protected] /tmp/build_6d259321/node_modules/readable-stream

       [email protected] /tmp/build_6d259321/node_modules/core-util-is

       [email protected] /tmp/build_6d259321/node_modules/isarray

       [email protected] /tmp/build_6d259321/node_modules/process-nextick-args

       [email protected] /tmp/build_6d259321/node_modules/string_decoder

       [email protected] /tmp/build_6d259321/node_modules/util-deprecate

       [email protected] /tmp/build_6d259321/node_modules/denque

       [email protected] /tmp/build_6d259321/node_modules/require_optional

       [email protected] /tmp/build_6d259321/node_modules/resolve-from

       [email protected] /tmp/build_6d259321/node_modules/semver

       mongoose-legacy-pluralize@1.0.2 /tmp/build_6d259321/node_modules/mongoose-legacy-pluralize

       [email protected] /tmp/build_6d259321/node_modules/mpath

       [email protected] /tmp/build_6d259321/node_modules/mquery

       [email protected] /tmp/build_6d259321/node_modules/bluebird

       [email protected] /tmp/build_6d259321/node_modules/mquery/node_modules/debug

       [email protected] /tmp/build_6d259321/node_modules/regexp-clone

       [email protected] /tmp/build_6d259321/node_modules/sliced

       [email protected] /tmp/build_6d259321/node_modules/mongoose/node_modules/ms

       [email protected] /tmp/build_6d259321/node_modules/mongoose/node_modules/safe-buffer

       [email protected] /tmp/build_6d259321/node_modules/sift

       [email protected] /tmp/build_6d259321/node_modules/memory-pager

       [email protected] /tmp/build_6d259321/node_modules/saslprep

       [email protected] /tmp/build_6d259321/node_modules/sparse-bitfield

       Installing any new modules (package.json)

       audited 78 packages in 0.902s

       

       2 packages are looking for funding

         run `npm fund` for details

       

       found 0 vulnerabilities

       

       

-----> Build

       Detected both "build" and "heroku-postbuild" scripts

       Running heroku-postbuild

       

       > [email protected] heroku-postbuild /tmp/build_6d259321

       > npm run install-client && npm run build

       

       

       > [email protected] install-client /tmp/build_6d259321

       > cd client && npm install

       

       added 32 packages from 25 contributors and audited 1775 packages in 20.51s

       

       72 packages are looking for funding

         run `npm fund` for details

       

       found 0 vulnerabilities

       

       

       > [email protected] build /tmp/build_6d259321

       > cd client && npm run build

       

       

       > [email protected] build /tmp/build_6d259321/client

       > react-scripts build

       

       Creating an optimized production build...

       Failed to compile.

       

       ./node_modules/@material-ui/core/esm/Slider/Slider.js

       Cannot find module: '../utils/reactHelpers'. Make sure this package is installed.

       

       You can install this package by running: npm install ../utils/reactHelpers.

       

       

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] build: `react-scripts build`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the [email protected] 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.kC8EO/_logs/2020-08-31T12_35_36_374Z-debug.log

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] build: `cd client && npm run build`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the [email protected] 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.kC8EO/_logs/2020-08-31T12_35_36_393Z-debug.log

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] heroku-postbuild: `npm run install-client && npm run build`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the [email protected] 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.kC8EO/_logs/2020-08-31T12_35_36_414Z-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://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits

       

       - Node version not specified in package.json

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

       

       - A module may be missing from 'dependencies' in package.json

         https://devcenter.heroku.com/articles/troubleshooting-node-deploys#ensure-you-aren-t-relying-on-untracked-dependencies

       

       love,Heroku

       

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

 !     Push Failed


解决方法

这是您的df2.mean(axis=1).sort_values(ascending = False) 库实例所需的模块,无法找到。尝试删除您的df2.mean(axis=0).sort_values(ascending = False) 文件夹,然后再次运行@material-ui。这将重新安装依赖关系树,并有望解决您遇到的问题。