我有一个节点应用程序已经在Heroku上运行了一年,但是最近的更新现在在构建时崩溃了。我以前从未见过此错误,也找不到任何帮助。
这是错误日志:
yarn run v1.12.3
$ react-scripts build
Creating an optimized production build...
Failed to compile.
./src/components/Admin_Navigation/navigation.css
Module build failed: Error: Unexpected "space" found.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sonar@1.0.0 heroku-postbuild: `yarn build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sonar@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.22xgq/_logs/2018-11-22T00_36_38_522Z-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:
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
我尝试了以下操作:
您的任何想法都会受到赞赏。谢谢
更新:这是由CSS中不必要的空格引起的。您可以手动在CSS上查找该空间,或者不那么理想的解决方案是将Node回滚到语法不那么严格的版本。