Some of the hosting providers don't allow installing npm and Node.JS on the shared hosting and you'll need to upgrade to dedicated hosting.
First of all, you'll need ssh access, you should ask your hosting provider to enable it for you or if you have access ot the control panel, then you can enable it yourself.
Using your terminal run the following command to access your server using ssh
It'll ask for your cpanel password.
Once you're logged in, you'll be able to install Node.JS
Congrats!! Now you should have npm and Node.JS installed on your shared hosting.
To check that everything installed properly, run those two commands to check the versions
The output supposed to be
If you have any problems installing them, let us know in the comments :)