Npm 当脚本返回1时,如何将gitlab作业设置为失败?

Npm 当脚本返回1时,如何将gitlab作业设置为失败?,npm,gitlab-ci,gitlab-ci-runner,Npm,Gitlab Ci,Gitlab Ci Runner,我有一个使用gulp构建的项目,我正在为持续集成建立GitLab管道 我提交了一些更改,使作业故意失败,命令失败,但作业以“成功”结束 这是输出: sh: 1: gulp: not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! Project@2.1.0 build-only: `gulp build-only` npm ERR! spaw

我有一个使用gulp构建的项目,我正在为持续集成建立GitLab管道

我提交了一些更改,使作业故意失败,命令失败,但作业以“成功”结束

这是输出:

sh: 1: gulp: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! Project@2.1.0 build-only: `gulp build-only`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the Project@2.1.0 build-only 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/2020-10-28T21_44_15_322Z-debug.log
                        Successfully built project!!                        
----->======================================================================
Saving cache
Not uploading cache path/to/cache due to policy
Cleaning up file based variables
Job succeeded
命令返回1,但作业仍将其视为成功

在这种情况下,如何设置作业失败