Hello,
how to update Node js version to higher one? Currently
(current: {"node":"0.10.40","npm":"3.3.6"})
Wanted atleast node version 4.
Thanks in advance.
Hello Andriy! Hope you're doing good!
So, this question is more related to updating Node itself. I've made some testing in a Ubuntu 18.04 that I have (running Bamboo Server in its latest version as off today, 6.7.1).
PS: For the below, make sure to execute proper backups, snapshot or whatever needed to rollback any change you make in your environment.
What I've tested:
- Installed node 0.10.40 from the main repository: http://nodejs.org/dist/
- If you're not sure how to install, you can always refer to the node documentation, i.e. here:
https://github.com/nodejs/help/wiki/Installation
- As soon as I've installed, I've let my server to re-check its local agent capabilities:
Upper Right Cog --> Agents --> Server Capabilities...
And I got the server to recognise my node installation.
I've then proceeded to create a task to run a nodeJS script, so I could check If my node was working and on the right version. Something like this:
console.log('This is a testing NodeJS');
console.log('This is the actual Node Version');
console.log(process.version);
The result, while I run the task, is expected, as you can see at the task logs screen below:
- Since what we wanted was to update the actual node version, I've used npm and the 'n' module for that, with some little trick.
The main article you can follow to perform this update, could be:
https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version
You should:
sudo npm cache clean -f
npm config set strict-ssl false <-- This is the trick, since the certificates for NPM are supposed to be outdated, due to being an old version. This avoids the "npm ERR! Error: SSL Error: CERT_UNTRUSTED you may get
sudo npm install -g n
sudo n stable
The recent stable version of node is v11.0.0. As soon as you update, since npm is supposed not to change default installation paths you should be able to view the updated version of node when you run the task again. Like I did:
I assume that the results would kinda be the same for remote agents.
If you have any other enquiry in regards to Node inside Bamboo, please make sure also to check our documentation here:
https://confluence.atlassian.com/bamboo/getting-started-with-node-js-and-bamboo-687213472.html
Cheers!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.