Mike
Mike

Reputation: 2735

Laravel Homestead Upgrading Node.js

I am new to Laravel but just installed a fresh installation of Laravel 5.1 on Homestead/Vagrant according to the docs.

When I do npm install, I get this warning:

vagrant@homestead:~/Code/Laravel$ sudo npm install
npm WARN optional dep failed, continuing [email protected]
npm WARN engine [email protected]: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.37","npm":"1.4.28"})

Is it safe to upgrade node.js and if yes, how? I read some articles where people destroyed their vagrant installation so I am afraid to do that. Any hints?

Upvotes: 0

Views: 3503

Answers (2)

Rafael F.
Rafael F.

Reputation: 126

Look at:

https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories#the-nodesource-linux-repositories


Installing Node.js v0.12 Debian / Ubuntu repository

Note the new setup script name for Node.js v0.12

curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -

Then install with:

sudo apt-get install -y nodejs

Upvotes: 1

DevAlien
DevAlien

Reputation: 2476

Node js > 0.12.0 is very supported, since it is around since a long time. you can upgrade.

But why do you do npm install in laravel, isn't it a PHP framework? In the install procedure in their website they don't mention npm, maybe I'm wrong.

EDIT: To manage node.js versions you can use nvm https://github.com/creationix/nvm This allows you to switch between versions easily, and install any version available without any issue. You can even set different versions for different paths.

Upvotes: 1

Related Questions