NodeJS 基于Jenkins的React应用构建

tgabmvqs  于 2023-08-04  发布在  Node.js
关注(0)|答案(1)|浏览(93)

如何在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

字符串

w80xi6nr

w80xi6nr1#

可能会遗漏react-scripts,因此需要安装它
npm i react-scripts
并仔细检查你之前执行过npm install!!!

相关问题