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

Although I follow the tips:

  • 'node' is not recognized as an internal or external command, operating program or batch file when using phonegap / cordova
  • Node.js does not recognize the system path?
  • 'ant is not recognized as an internal or external command ...

I had a strange problem: Resume, although the node path is a list in Path, it does not find the 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 by adding a variable to environment variables and displaying Ok in the path:

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

The 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 go to the list of folders in Path, then it will work fine.

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

Seems controversial.

+10
source share
10 answers

The nodejs directory in your PATH not recognized because there is a space before the semicolon, so Windows is looking for a directory with a space at the end of a name that does not exist.

+7
source share

Error: 'node' is not recognized as an internal or external command

The problem may be that node is not installed on the computer the application is running on.

Then set it and set the environment variable for nodejs.

Or

Another reason might be the nodejs path, which is not set in the environment variable.

Pay attention to the following: open the control panel → System and Security → System → Advanced system settings → Environment variables → Path

nodejs path should be available here. If not available, add the following:

C: \ Program Files (x86) \ nodejs OR C: \ Program Files \ nodejs

Now restart the application and the error has been resolved.

+5
source share

; C: \ Program Files \ nodejs \

The slash after \ nodejs \ worked for me

+3
source share

Normally, environment variables are not valid until the Restart system.

I offer System Restart for all those who face the same problem when doing a clean install.

It worked for me.

+3
source share

If you did npm install jasmine-node -g , you just need to do the jasmine-node spec (no call prefix).

+1
source share

On Windows, you need to set the path to the node.js folder to system variables or user variables.

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

2) in the "User Variables" or "System Variables" section, find the PATH variable and add the path to the node.js folder as the value. This is usually C:\Program Files\nodejs; . If the variable does not exist, create it.

3) Restart the IDE or computer.

It is also useful to add the paths "npm" and "Git" as variables separated by semicolons.

+1
source share

If you checked your PATH and you are sure that the path for the node added correctly, then you will probably encounter a problem while running the node OR npm commands with a CLI different from the default command line interface for the operating system (for example, Git bash on Windows )

The weird part is that you can test node -v and npm -v in these CLIs, but for some reason they don't work very well with these commands (especially when combined with install or update ).

Possible Solution

Try starting node with the default terminal for your OS.

0
source share

I ran into this problem even after adding node.exe to PATH. I was unable to run the node command in random places without running the command line as an administrator.

The solution to this problem is that you must provide full access to this node.exe file for different types of users. open the node.exe properties, go to the security tabs, check all the security settings for the user on the local computer.

after that you can access the node.exe file from anywhere.

0
source share

Mistake:

node-is-not-recognized-as-an-internal-or-external-command

And the following solution:

  1. Set the NODE_HOME environment NODE_HOME as C:\Program Files\nodejs
  2. Open the cmd window and run:
 cd "C:\Program Files\nodejs" npm install connect npm install -g appium 
-one
source share

This is as simple as adding the location of nodejs ( C:\Program Files (x86)\nodejs ) to your PATH variable and restarting the application using Run as Administrator.

-3
source share

All Articles