首页 > 解决方案 > 在 gitlab-ci 上构建反应应用程序时出错

问题描述

当我在本地构建时,我正在尝试使用 GitLab-ci 部署一个反应应用程序,它工作正常,但是在管道上构建时,我在构建完成之前收到错误:

 npm ERR! code ELIFECYCLE
 npm ERR! errno 1
 npm ERR! spinspace-admin@0.1.0 build: `react-scripts build`
 npm ERR! Exit status 1
 npm ERR! 
 npm ERR! Failed at the spinspace-admin@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!     /root/.npm/_logs/2020-05-20T18_07_19_210Z-debug.log
Running after_script
00:01
Uploading artifacts for failed job
00:02
 ERROR: Job failed: exit code 1

这是我的 GitLab-ci.yaml 中的 before_script

before_script:
    - apt-get update
    - npm install
    - npm run build
    - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
    - mkdir -p ~/.ssh
    - eval $(ssh-agent -s)
    - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'

请问我需要帮助...

标签: reactjsnpmgitlabdevopsgitlab-ci

解决方案


推荐阅读