Node JS NPM

Fix node is not recognized as an internal or external command Error

Node.JS images, logo
Written by VithalReddy.M.B

Errors, Every Programmers Nightmare!, Maybe not, Solving a simple error can take so many sleepless nights, But All thanks Development in Modern Technology and Rapid growth of Google Search Engine and Ever growing Community of developers worldwide, now you can search your error in google and it’s already been solved by other fellow developers, Today we are going to solve or try to solve a common error of Node.JS that is “node is not recognized as an internal or external command Error“.

Things Responsible for node is not recognized as an internal or external command Error are

  • Node.js is not installed properly.
  • Environment variables are not set properly.
  • Whitespace in path variable can also be the reason.
    C:\Users\myUser>path
    PATH=c:\Program Files (x86)\nodejs ;  //remove whitespace after nodejs
  • If you installed Nodejs setup just now, then you need to restart your pc.

Now let’s see how to solve it,

How to Solve node is not recognized as an internal or external command Error

  • First of all, If you’ve installed Nodejs first time, then you need to restart your pc.
  • If you’re using Windows pc, then set Node.js folder path into system variables.
    Control Panel >> System and Security >> System >> Advanced System Settings >> Environment Variables
  • Find PATH variable in Environment Variables see if C:\Program Files\nodejs; variable exists, if not then create and restart your machine.
  • You can also do that by using Command Line using command  SET PATH=C:\Program Files\Nodejs;%PATH% or SET PATH=C:\Program Files (x86)\Nodejs;%PATH% depending on your pc config.
  • If you’re using the older version of Node.js, you can update your Nodejs and It will automatically set system variables. You can check our guide on How to Update Node.JS to Latest Version (Linux, Ubuntu, OSX, Windows, Others)
  • Nodejs’s installation adds nodejs to the path in the environment properties incorrectly sometimes.By default, it adds the this to the path C:\Program Files\nodejs\ The ending \ is unnecessary. Remove the \ and everything will be working again.
  • You can also Go to the folder in which you have Node and NPM (such as C:\Program Files (x86)\nodejs\) and type the following command and this may solve your error:
    > set path=%PATH%;%CD%
    > setx path "%PATH%"

I hope this above hacks helped to fix node is not recognized as an internal or external command error and please comment if you have any queries. Thanks for reading this quick fix guide.Do subscribe to Our Newsletter for awesome Nodejs related stuffs.

READ  Push and Pop Items Into MongoDB Array Via Mongoose in Node.js

About the author

VithalReddy.M.B

Vithalreddy.M.B is the Editor of VMRworld.com & stackFame.com with a focus on startups, Startup News, Business, and Technology.He is also an Electrical & Electronics Engineer, Technology Lover, and Entrepreneur by choice.Started His first startup at 21.