Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gulp command not found (Mac OS)

Tags:

node.js

gulp

I have been trying to setup an angular js project with yo, grunt and generator-gulp-angular. Although I install all packages, gulp comand is not found, however it works if I go inside node_modules.

This code will explain my issue:

$ npm -v
# 2.5.1
$ npm install -g yo
$ npm install -g generator-gulp-angular
$ mkdir client && cd $_
$ yo gulp-angular ng_demo
$ gulp serve
# command not found
$ node_modules/gulp/bin/gulp.js serve
# works

I am using zsh. What may be going wrong?

like image 536
roxxypoxxy Avatar asked Nov 29 '22 10:11

roxxypoxxy


1 Answers

Check that you installed gulp globally:

npm install -g gulp

Another idea is to add scripts to your package.json file along the lines of:

{
  "name": "testing-app",
  "version": "0.9",
  "scripts": {
    "gulp": "gulp",
    "serve": "gulp serve"
  }
}

Then use npm run serve...

like image 74
apotry Avatar answered Dec 06 '22 12:12

apotry