ng: Permission denied pipeline cicd gitlab

Viewed 48

I have a .yml file that contains my pipeline cicd of gitlab but when execute the build job , show me this message is a angular application ng: Permission denied

enter image description here

image: node:latest
before_script:
  - npm install

this is my job

build-npm-prod:
  stage: build
  script:
    - rm ./package-lock.json
    - npm run build --prod
  artifacts:
    paths:
      - dist/mi-web-texo/
  only:
    - master

Yesterday this worked

1 Answers

Check first if; as in this instance, it is because your repository has, between yesterday and today, versioned the node_modules folder.

Removing that folder from the repository, adding and pushing, should allow your GitLab pipeline to run, and ng to operate without permission issue.

See also if disabling cache for the job would help (see documentation):

build-npm-prod:
  stage: build
  cache: []                   <=====
  script:
    - rm ./package-lock.json
    - npm run build --prod
  artifacts:
    paths:
      - dist/mi-web-texo/
  only:
    - master
Related