0

I am trying to deploy a react app using GitLab-ci when I build on local it works fine but when building on the pipeline I get the error just before the build complete:

 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

This is the before_script in my GitLab-ci.yaml

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'

please I need help...

Valeed Anjum
  • 447
  • 1
  • 5
  • 17
Henry Okonkwo
  • 363
  • 7
  • 17
  • This looks more of an issue with the react application codebase. – hdhruna May 21 '20 at 08:15
  • It seems the issue comes from NPM. I found some solutions in this post, please check [npm ERR! code ELIFECYCLE](https://stackoverflow.com/questions/42308879/npm-err-code-elifecycle) – Amir Dadkhah May 21 '20 at 10:17

0 Answers0