Steve Greco
Steve Greco

Reputation: 53

Gulp Command not being found

I have attempted to install Gulp using NPM but the gulp command is not getting recognized. These are the commands I ran. I am using Git Bash and running it as admin. I am using Windows 10.

npm install gulp-cli --global

( Attempt to run 'gulp' and 'gulp -v' and nothing works )

Then navigating to my project folder

npm install gulp --save-dev

( Attempt Gulp command again and it still not recognized )

My env path for npm is C:\Users\ *username* \AppData\Roaming\npm

When I run

npm config get prefix

It returns C:\Program Files\Git\Roaming\npm

I am fairly new to NPM but I have been searching for hours and trying everything. I have uninstalled and reinstalled Node and npm multiple times. Sorry if this has been answered before but every other thread I found did not solve this issue.

Upvotes: 0

Views: 5014

Answers (3)

ispirett
ispirett

Reputation: 666

This worked for me:

npm config delete prefix

Upvotes: 0

ispirett
ispirett

Reputation: 666

Add gulp to scripts in your package.json file:

"scripts": {
"gulp":"gulp"
},

Then you can use the command:

npm run gulp name of task

Writing function like this worked for me:

gulp.task('message', async ( ) => { 

 console.log('gulp task is working ')
})

Upvotes: 1

Arash Hatami
Arash Hatami

Reputation: 5541

Install gulp and gulp-cli globally

npm install --global gulp-cli    
npm install --global gulp   
npm install gulp -D

Update:

Make sure install gulp locally and globally. After that check status using these command :

npm ls
npm ls -g

After that make sure to link gulp

npm link gulp

And maybe you should check you env.

  1. Create an environmental variable called NODE_PATH
  2. Set it to: %AppData%\npm ( It's you npm path )
  3. Close CMD, and Re-Open to get the new ENV variables

Upvotes: 2

Related Questions