Wednesday, 20 September 2017

How to update node on homestead?

I am learning the Angular and reading the tutorial https://angular.io/guide/quickstart .

I noticed this sentence. "Verify that you are running at least node 6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors, but newer versions are fine." .

checked with my homestead.
node -v
v5.10.0
npm -v
3.10.10

npm is OK, but node is older versions. It could produce errors.

So, my question is, "how to update node in my homestead VM?"

searched a lot of solution online, include StackOverflow but didn't work. After a few hours, node version is still v5.10.0. So, I looked at the nodejs.org website.

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

And I think why not follow the nodejs.org website?

chose Debian-and-ubuntu-based-Linux-distributions because homestead os is ubuntu.

Type
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
 
I think it means download node6.x version ?
 
Then type 
 sudo apt-get install -y nodejs
 
I think it means install nodejs. 
 
After a few seconds. check 
node -v 
It gave me this 
v6.11.3
 
Means updated success!!!! 



 

No comments:

Post a Comment