我将我的样式从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.发布于 2018-01-27 12:31:42
我的问题是将"react-app-rewired": "^1.4.0"作为"devDependencies",而不是在"dependencies"中进行生产:)
https://stackoverflow.com/questions/48472491
复制相似问题