Please enable Javascript for better experience...
'gulp' is not recognized as an internal or external command
By Big | Jul 7, 2017 | In Articles | Update: Nov 18, 2017 | Total Views [ 484 ]
Taged In
(1 Like)
Rate

You can remove error 'gulp' is not recognized as an internal or external command by adding gulp path in PATH variable in environment variable.

Introduction

When you work on a project in your organization, 90% chances are that you get everything ready for you and you just start coding step by step because there are many people around you who do this work for you. But think of a scenario where you want to create a project at your home or you get an opportunity to work on a new project, the first thing where you may get stuck is the environment setup. Here I am sharing one of the instance where I was setting up my angular js application. For this, I installed required softwares and tools. I installed npm globally using npm install -g npm. I tried to install gulp using command npm install -g gulp which was an easy installation but after running gulp command in command prompt, it threw an error 'gulp' is not recognized as an internal or external command. Most interesting point is that you will face this gloabally as well as in your local project folder. In this article I will discuss both.

Next step to follow

It was a simple mistake I forgot to implement. Simply add path of gulp in PATH variable in environment variable. Only point to remember is that copy path till npm only. You can find npm folder in AppData folder in user's account. To set it for every user use like below.

%AppData%\npm

Follow below steps to setup gulp successfully.

1) I assume that npm, gulp is already installed globally and it looks like below. Go to location: C:/ > Users > Your UserName > AppData > Roaming

image

2) Now go to My Computer > Properties > Advance system settings > Environment Variables

image

3) Click "New" to add new variable "NODE_PATH" and add path of "node_module" in value field.

image

4) It will be added in system variable section.

image

5) Edit "Path" variable.

image

6) Add "Node_Module" path till "\AppPath\Roaming\npm" in Path variable as shown in below screenshot. Copy %AppData\npm to your Path variable.

image

7) Open command prompt and write "gulp -v". You will see gulp version showing on screen.

image

If version is showing correctly, means we are done. Now you can use gulp without any error.

Hope it helps you. Now you can use gulp as per your requirement to build and run your angular js application as well as for other related tasks.

Share this

About the Author

Big
Rahul Jha (Big)
Founder, Developer dotnet-concept.com
Has working experience in different phases of Software Development Life Cycle (SDLC) in CMS, Gaming, Health Care and Financial Services domain using Agile pattern. Working experience in Design patterns, ASP.NET, MVC, Windows application, WCF, ADO.NET, SQL Server and Test Driven Development (TDD) environment with JQuery, JavaScript, N-Unit, Entity Frameworks, LINQ, Code Refactoring and Business Objects Models.

 
Please SignUp/Login to comment...

Or comment as anonymous...
* Name
* Email ID
Comment