如何在Jenkins中构建React应用程序?我尝试使用npm run build命令,但在Jenkins上出现错误。有人能帮我吗?
我面临以下错误
> react-scripts build
sh: 1: react-scripts: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! maintenance_web@0.1.0 build: `react-scripts build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the maintenance_web@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-08-02T18_36_55_475Z-debug.log
Post stage
字符串
1条答案
按热度按时间w80xi6nr1#
可能会遗漏
react-scripts
,因此需要安装它npm i react-scripts
个并仔细检查你之前执行过
npm install
!!!