Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


NPM is not found in script



In the pipeline step, I have added multiple scripts something like 

image: drupal:9.5.11-php8.1-fpm
      - step:

            - scripts/pipelines/
            - scripts/pipelines/
            - scripts/pipelines/
            - scripts/pipelines/
            - docker
            - mysql
            - docker
            - node
            - composer

I used an image where node and npm are unavailable, so I need to install the node using nvm in 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 ( to run npm install and npm run build.


Inside, 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.

2 answers

0 votes
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 15, 2023

Hi @Amit Sharma,

Thank you for reaching out to the community.

May we know how you're installing NPM in your build?
This is because when I tried using the base Docker image (drupal:9.5.11-php8.1-fpm), I got the same error message when running the NPM command because NPM is not available from the base Docker image.

+ npm --version
bash: npm: command not found

Mark C

Yes @Mark C  I am installing the npm in my script 


in the above script I am installing and setting up the path of node and npm.

Also, I have checked the version. I installed the node using nvm. 

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Oct 18, 2023

Hi @Amit Sharma

Thanks for that.
Could we check if the NPM is still installed after running script?

            - scripts/pipelines/
            - npm --version
            - scripts/pipelines/
            - scripts/pipelines/
            - scripts/pipelines/

You can also try installing NPM as part of the step script instead.

Let me know how it goes.

Mark C

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Oct 12, 2023

Hi @Amit Sharma

Is running in a different step? If so, node cache only caches node_modules not the actual node install.

@Saxea _Flowie_  it is running inside the same step. I have added multiple scripts in the same step for reusability in other steps.

@Saxea _Flowie_  I am running the Acquia BLT command in the, which runs a post-code hook. Inside this hook, I am running the

BLT picks the path of npm installed in the current container. I have used this on the local but it is not working in Pipeline.

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events