Installing NodeJS via Instance Setup Script

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
Accepted answer

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

... 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?

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

Hello? Does anyone have any suggestions?

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

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

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

Thanks for your help! :)

you could do

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

in your instance setup script

That worked fantastically, thanks!

Suggest an answer

Log in or Sign up to answer
Community showcase
Asked Thursday in Jira Ops

I'm John Allspaw, Ask Me Anything about incident analysis and postmortems

I'm John Allspaw, co-founder of   Adaptive Capacity Labs, where we help teams use their incidents to learn and improve. We bring research-driven methods and approaches to drive effective inciden...

2,513 views 8 7
View question

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you