Background:
In the pipeline step, I have added multiple scripts something like
image: drupal:9.5.11-php8.1-fpm
pipelines:
branches:
test:
- step:
script:
- scripts/pipelines/setup.sh
- scripts/pipelines/validate.sh
- scripts/pipelines/build_artifact.sh
- scripts/pipelines/deploy_artifact.sh
services:
- docker
- mysql
caches:
- docker
- node
- composer
I used an image where node and npm are unavailable, so I need to install the node using nvm in setup.sh. I am able to install node and npm and the commands successfully are running properly in the setup script.
I am using Acquia BLT in this pipeline. BLT command is running post code command hook where I am running one script (frontend_build.sh) to run npm install and npm run build.
Problem:
Inside frontend_build.sh, it is giving an error "npm command not found".
Solution Tried:
- I tried to update the PATH variable and source ~/.bashrc. This shows showing updated path.
- Tried to export the npm path in the custom variable but nothing works.
Suggestions are welcome.
Thanks very much for all the help.