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

This widget could not be displayed.

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
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

264 views 1 3
Join discussion

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