I have tried several answers to other questions about updating node.js. However, none has worked for me inside the Laravel Homestead in MacOS.
I currently have the 5.12.0 version.
I have tried the following commands:
sudo npm install update
sudo npm install -g npm
sudo npm install -g npm@latest
And after restarting (with --provision) the machine, node -v
still shows the same version.
Any ideas to update it in Homestead?
Solved
I have followed this answer:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Then I exited
exit
And then I restarted the machine like so:
vagrant reload --provision
I typed node -v
and now it outputs v6.2.2
and that did the trick.
However, these steps did not work in the mac terminal!