Run node and npm in Windows Server 2008 R2 via SSH

2

I've installed FreeSSH in my Windows Server 2008 R2 and I can SSH with PUTTY, the SSH works fine but I can not run node or npm from the SSH terminal, Error says command not recognized.

Is there some configuration missing?

EDIT 1

I cant actually run node and npm specifying the full path or when in nodejs folder, thoughts?

Gabriel Matusevich

Posted 2015-08-05T22:55:20.053

Reputation: 121

yes, I can access the server via Team Viewer, I can run the commands from the cmd, but not via SSH – Gabriel Matusevich – 2015-08-05T22:58:40.543

i can run them from the nodejs installation folder, ideas? – Gabriel Matusevich – 2015-08-05T23:01:56.340

i don't know, where is it suppose to be, this is windows server 20008 r2 – Gabriel Matusevich – 2015-08-05T23:03:49.453

It's a Windows Server 2008, those commands are for linux – Gabriel Matusevich – 2015-08-05T23:06:18.137

going over there – Gabriel Matusevich – 2015-08-05T23:10:04.893

Are they in PATH? – Jared Allard – 2015-08-06T22:05:55.727

Answers

0

Try this to make a symbolic link to node and npm

Note: this isn't the cleanest way of doing things, but this will work.

From a Command Prompt run:

mklink %userprofile%\node.exe "C:\Program Files (x86)\nodejs\node.exe" and mklink %userprofile%\npm.exe "C:\Program Files (x86)\nodejs\npm.exe"

This will create a Hard link to the files node and npm in your home directory allowing you to just enter node or npm once you log in through SSH

td512

Posted 2015-08-05T22:55:20.053

Reputation: 4 778

i get incorrect syntax error – Gabriel Matusevich – 2015-08-05T23:28:23.433

D: Still wrong syntax – Gabriel Matusevich – 2015-08-05T23:32:18.260

1I ran the commands separetly and I they worked but still can't run node or npm via SSH – Gabriel Matusevich – 2015-08-05T23:34:19.257

I might have some insight, when running the command "whoami" from the SSH console I get "win2k8_nodejs/administrator", win2k8_nodejs is the PC name, but there is no user profile named that way, could that be it? – Gabriel Matusevich – 2015-08-06T00:02:40.367

from the server itself via TeamViwer the command whoami also displays the same user, so I really don't know what's going on – Gabriel Matusevich – 2015-08-06T00:06:57.823