【发布时间】:2019-01-21 23:36:09
【问题描述】:
我使用 create-react-app 命令创建了一个 react 应用程序,并尝试使用 https://github.com/mars/create-react-app-buildpack#quick-start 上的说明将其部署到 heroku 上
但是,在尝试推送到 heroku 时,我想出了以下构建失败,其中构建日志显示:
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/newsapi/index.js:17
Read more here:
https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sports-news-app@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sports-news-app@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! /app/.npm/_logs/2018-08-15T03_41_33_617Z-debug.log
! Push rejected, failed to compile React.js (create-react-app) multi app.
! Push failed
newsapi/index.js 在第 17 行读取
let API_KEY; // To be set by clients
【问题讨论】:
-
在收到此错误消息之前您使用了哪些命令?
-
git push heroku master