2

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!

1 Answer 1

0

Try this command:

apt-get install npm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.