Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

989
Visualizações
GitLab CI/CD shell executor: npm command not found

On my server, I have configured the gitlab runner to use the shell executor. And which node command gives: /home/ubuntu/.nvm/versions/node/v14.11.0/bin/node.

So, my gitlab-ci.yml file has the following:

stages:
  - prepare
  - check
  - deploy

default:
  before_script:
    - export PATH=$PATH:/home/ubuntu/.nvm/versions/node/v14.11.0/bin

prepare:
  stage: prepare
  only:
    refs:
      - dev
  before_script:
    - export PATH=$PATH:/home/ubuntu/.nvm/versions/node/v14.11.0/bin
  script:
    - npm i --ignore-scripts --include=dev
  cache:
    key: $CI_COMMIT_BRANCH
    paths:
      - node_modules/

The prepare job, throws npm: command not found error, and the pipeline fails. How to resolve this issue?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You can add to your script: step, before the npm command line:

- echo "PATH='${PATH}'"

That way, you can check if the path is actually modified.

Try adding quotes:

- export PATH="$PATH:/home/ubuntu/.nvm/versions/node/v14.11.0/bin"
over 4 years ago · Santiago Trujillo Relatório

0

Shell executor uses .profile to load env. You can make gitlab-runner use nvm by adding this to gitlab-runners $HOME/.profile:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda