Installing NodeJS via Instance Setup Script

Rohan Eldridge November 18, 2013

We're using the Default S3 i386 AMI (ami-a10b44c8) and I'd like to install nodejs and npm on the elastic agent using an instance setup script.

I've noticed that most guides for node suggest installing it from source which is unacceptable due to the amount of time it would take to build.

Is there some other way we can get it on the agent? Do we have to make a snapshot and set it up that way?

1 answer

1 accepted

0 votes
Answer accepted
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2013

Stock images already contain node/npm. Do you need a newer version?

Rohan Eldridge November 18, 2013

... OK, I feel like an idiot now for assuming it wasn't installed :(

Sorry about that.

On that note though, is there a list of all the packages installed by default on the stock images?

Rohan Eldridge November 18, 2013

OK, it doesn't seem to be working, here's an example of what I'm getting:

19-Nov-2013 12:13:03line 15: node: command not found

19-Nov-2013 12:13:03line 17: npm: command not found

This is from a 'script' build task that simply calls node -h and npm -h

Rohan Eldridge November 18, 2013

Hello? Does anyone have any suggestions?

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 18, 2013

node is not on PATH, check in /opt directory.

You can find all tools on image capabilities page in Bamboo.

Rohan Eldridge November 19, 2013

Ah, I see now. Could I put it in the path somehow for the instance via the setup script?

Thanks for your help! :)

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2013

you could do

echo 'export PATH=$PATH:WHATEVER_YOU_WANT' >> /etc/profile.d/bamboo.sh

in your instance setup script

Rohan Eldridge November 19, 2013

That worked fantastically, thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events