[solved] node and npm command-line



I upgraded from shared to VPS and looked forward to finally using Gulp/Grunt and other node-based tools in my shell.
However, ‘npm’ and ‘node’ are not recognised…

Do I really have to install node via nvm in order to get this? :slight_smile:

I did create a subdomain and enabled node.js for it, just in case.

I am mainly using PHP so changing my main domain to use node.js is not a good idea.
Both because it is PHP and because it is not served from a ‘public’ subdirectory.


What I did not do was to change my ssh command to use the ps format.

Instead of using:
ssh username@domain.com

I changed to using
ssh username@psxxxxxxxx.dreamhost.com

and node and npm worked a treat :slight_smile:

Strange that my happy Dreamhost robot didn’t tell me to change my ssh connect. But I am happy. :wink:


Have you tried doing gulp? I’m currently trying to get gulp to work on my VPS, and it seems to be installing gulp correctly with npm install gulp --save-dev. But, when I run the command it says gulp not found.


I haven’t had the time to try it yet, but I will - and I found this StackOverflow question that will help us to use a locally installed Gulp:

There are two easy ways to do it.
Either by adding a ‘scripts’ section to package.json so that we can use 'npm run thescript’
or simply by specifying the full path to the locally installed gulp: ‘./node_modules/.bin/gulp’