Reputation: 874
I am running a fresh image of a Google Compute Engine VM with Node.js v6.16.
How do I update this to latest? v6 doesn't even support async functions.
Upvotes: 2
Views: 1150
Reputation: 572
In order to update Node.js, first SSH into the instance, you can do it from the Deployment Manager Console view, clicking the "SSH" button.
Then, in the instance, you can check the version of Node.js with this command:
node -v
To update Node.js enter the next commands, (check codeforgeek.com):
sudo -s
npm cache clean -f
npm install -g n
n stable
Then exit the session and log in again, or reboot the VM, and if you check the version it will be the updated one.
Upvotes: 3