asher
asher

Reputation: 1

npm global install not recognized (gulp)

I'm trying to use gulp for the first time.

Following instructions online, I installed it globally as well as locally, but I still get the 'gulp' is not recognized as an internal or external command[...] error. When using PowerShell instead of cmd the error is the term 'gulp' is not recognized as the name of a cmdlet, function, script file[...]

I've tried:

I'm stumped. On top of all that, I have other npm packages installed globally that work fine.

Edit: I fixed this by adding npm to my PATH environment variable. I had been adding it to NODE_PATH, which doesn't work for CLI use.

Upvotes: 0

Views: 268

Answers (2)

Anushil Kumar
Anushil Kumar

Reputation: 692

You can add the gulp script in the package.json file and run the gulp command using npm.

Ex:

  • gulp task name : helloTest
  • Add below code in package.json:
 "scripts": {
     
        "helloTest": "gulp helloTest",
  }

And now type below command in terminal:

npm run helloTest

Upvotes: 0

yoonicode
yoonicode

Reputation: 1477

"Global install" with the -g flag basically means you install the command provided with the package.

To globally install gulp:

npm install gulp -g

Upvotes: 0

Related Questions