Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

LaraBABA's avatar

Playing with Laravel but no NPM and Node.js

Hi all,

I am stuck there....

I have purchased a Cloud VPS at 45 USD per month with Cpanel. While trying to run node and npm I found that both were not installed.

I contacted my VPS support and they have told me that cpanel does not support this, therefore they cannot provide support for it.

What other alternatives there are if I cannot use NPM and NODE.js on my vps please? I am from a windows background, Linux and me...a bit of a miss on that one...

Thanks.

0 likes
8 replies
Cronix's avatar

Just compile your assets on your dev machine and not the production box? The only thing the production box needs are the compiled js/css files and whatnot. I don't even have a /node_modules dir on my production boxes.

2 likes
LaraBABA's avatar

Yes you have a good point there...:-) The reason I was working on my remote server directly was because I had email issues with Mailgun and ip addresses, I was trying to change the work on my "non-live" remote server as my project is not yet launched.

But yes you are right, I will have to do it this way.....Thanks!

Robstar's avatar

It appears you have a a managed server with a limited Cpanel account and no root access. I'm not sure why your host would say it;s not possible to install Node, as it's just a server at the end of day.

The first result in Google states otherwise too :)

https://www.simpleservers.co.uk/clients/whmcs/knowledgebase/605/Install-nodejs-on-Cpanel-Server.html

If you're just testing, I'd recommend setting up a local environment yourself using Homestead or Laradock. That gives you a server, for free, that you can experiment with.

If it's a real site I'd personally go for DigitalOcean or AWS.

For the record, you CAN use Node on your server - your host is being a pleb and unhelpful :) If you have a good managed host they will install things for you.

LaraBABA's avatar

Thanks for the reply,

Yes this is what I thought too, that they were not very helpful. They have also told me that they do not have single customer using cpanel and node/npm which I find strange.

I tried to install them on CENTOS 7.5 kvm - Linux 3.10.0-862.3.3.el7.x86_64 but kept having errors. Also being a windows user, I was struggling with the SSH commands, ie:

This is what I did at the moment and got stuck: ################################# I ran this command #node -v and got the result V6.14.2

From what I can see on the node website the latest version is V8.11.3

I found a tutorial that says to run this command: #wget https://nodejs.org/dist/v8.11.3/node...nux-x64.tar.xz

Here is the reponse: ###################################### HTTP request sent, awaiting response... 200 OK Length: 11351132 (11M) [application/x-xz] Saving to: ‘node-v8.11.3-linux-x64.tar.xz.1’

100%[======================================>] 11,351,132 1.31MB/s in 7.4s

2018-06-27 19:48:40 (1.46 MB/s) - ‘node-v8.11.3-linux-x64.tar.xz.1’ saved [11351132/11351132]

######################################

So from what I understand, Node has been downloaded but not installed.

The tutorial then says to do this: #tar -C /usr/local --strip-components 1 -xJf node-v8.11.3-linux.x64.tar.xz

But on this command I get this error:

[root@web ~]# tar -C /usr/local --strip-components 1 -xJf node-v8.11.3-linux.x64.tar.xz tar (child): node-v8.11.3-linux.x64.tar.xz: Cannot open: No such file or directory tar (child): Error is not recoverable: exiting now tar: Child returned status 2 tar: Error is not recoverable: exiting now [root@web ~]# ####################################

Cronix's avatar

Are you running that command in the same dir as the node file you downloaded?

LaraBABA's avatar

I am running it in the same folder where I ran the wget command.

Cronix's avatar

The only thing that really stands out is

Saving to: node-v8.11.3-linux-x64.tar.xz.1

tar -C /usr/local --strip-components 1 -xJf node-v8.11.3-linux.x64.tar.xz

The filenames aren't the same. One has a .1 at the end.

LaraBABA's avatar

I am wondering if the "--strip-components 1" from the second command has something to do with that. I copied both commands from a centos installation website "as is"

Please or to participate in this conversation.