I am trying to install connect.js in my computer. After installing Node.js using the .msi installation file (i.e. npm has already been installed along with it) the Windows cmd window shows this error:

'node' is not recognized as an internal or external command, operable program or batch file.  

By default node installs into C:\Program Files (x86)\nodejs and adds itself to the PATH variable. If you have done a default installation of node.js (i.e. Node.js Windows Installer (.msi)), it can be started from the command prompt by typing node.

From the cmd window type:

cd "C:\Program Files (x86)\nodejs"
npm install connect  

If you have installed node.js to a different directory, instead of "C:\Program Files (x86)\nodejs" substitute the path to nodejs in the first command.

  • Thanks so much for your response.I did as you suggested.It is not showing me any error anymore.But when i type "npm install connect",the server still does not show. I am wondering what i am doing wrong here. – afriend Oct 19 '14 at 18:21
  • At what point during or after you run npm install connect does the server still not show? Can you run the "Hello World" example found at nodejs.org using the "Hello World" code from this answer? This simple web server written in Node responds with "Hello World" for every request. – karel Oct 19 '14 at 20:15
  • Thanks for your response.After loading the code to example.js,i run it on window command.Here is what i got – afriend Oct 20 '14 at 0:33
  • Thanks for your response.Server NEVER show at all.After loading the code to example.js,i run it on window command.Here is what i got C:\WINDOWS\system32>node example.js mode.js:340 throw err; Error:cannot find module C:\WINDOWS\system32\example.js at Function.Module_resolveFilename(module.js:338:15) at function.module_load(module.js:2:25) at function.module.runmain(module.js:497:10) at startup (node.js:119:16) at node.j:906:3 – afriend Oct 20 '14 at 0:43
  • I really dont know what i am doing wrong with this.I need help – afriend Oct 20 '14 at 0:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.