Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

node is not recognized as an internal or external command but is in PATH

Tags:

node.js

Although I've follow suggestions from:

  • 'node' is not recognized as an internal or an external command, operable program or batch file while using phonegap/cordova
  • Node.js doesn't recognize system path?
  • ‘ant’ is not recognized as an internal or external command...

I'm having an strange issue: Resume, although node path is list in Path, it doesn't find node.

Workflow:

Microsoft Windows [Version 6.3.9600]    //Running CMD on windows 8.1 
(c) 2013 Microsoft Corporation. All rights reserved.

I followed suggestions in SO, adding variable to Environment Variables, and it's display Ok in Path:

C:\Users\myUser>path
PATH=c:\Program Files (x86)\nodejs ; (...omitted...) //So folder is there

Next line will fail

C:\Users\myUser>call jasmine-node spec  
'node' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\myUser>cd "c:\Program Files (x86)\nodejs" //So I move to the folder list before...

But if I move to folder list in Path, then it works OK.

c:\Program Files (x86)\nodejs>call jasmine-node spec
>  (...omitted...) //Exec OK.

c:\Program Files (x86)\nodejs>node
>   //Exec OK. Waiting...

It seems contradictory.

like image 420
Mario Levrero Avatar asked Oct 01 '14 15:10

Mario Levrero


1 Answers

In Windows, you need to set node.js folder path into system variables or user variables.

1) open Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables

2) in "User variables" or "System variables" find variable PATH and add node.js folder path as value. Usually it is C:\Program Files\nodejs;. If variable doesn't exists, create it.

3) Restart your IDE or computer.

It is useful add also "npm" and "Git" paths as variable, separated by semicolon.

like image 59
webmato Avatar answered Oct 10 '22 13:10

webmato