我将样式从 material-css 转换为 ant.design。为此,我必须将我的客户端 package.json 更改为拥有react-app-rewired
而不是react-scripts
:
"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test --env=jsdom",
"eject": "react-scripts eject"
},
当我将其推送到 heroku 时,它找不到命令。为什么是这样?
我从 heroku 构建日志中收到以下错误:
> react-app-rewired build
sh: 1: react-app-rewired: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! client@0.1.0 build: `react-app-rewired build`
npm ERR! spawn ENOENT
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! /app/.npm/_logs/2018-01-27T03_26_58_947Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! infinity2o_server@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 infinity2o_server@1.0.0 heroku-postbuild script.