Windows 10 pro x64
I ran the following commands
npm install --global gulp-cli
npm init
Then I changed directory to my project:
I'm using Ubuntu and found the error of -bash: gulp: command not found
, too. But it became work after npm install gulp -g
On MacOS Sierra v10.12.6, the following global install with sudo worked for me.
sudo npm install gulp -g
I managed to fix this problem using simple 3 commands found from https://gulpjs.com/
npm install gulp-cli -g
npm install gulp -D
npx -p touch nodetouch gulpfile.js
Hope it helps someone else.
ps: it is not mandatory to use the 3rd command in order to fix the problem.
I solved the problem creating an alias in ~/.bashrc like this:
alias gulp="node /home/deploy/app/node_modules/gulp/bin/gulp.js"
Just put the alias in the end of the .bashrc file, then run:
source ~/.bashrc
Test with:
gulp -v
You should see something like this:
[15:46:39] CLI version 3.9.1
[15:46:39] Local version 3.9.1
I had got into the same issue. Even after npm install gulp -g
and npm install bower -g
, both gulp and bower showed the error.
Here is the thing to remember.
1. gulp and bower command does not run in root (sudo
). Switch back to the system user and the run it
2. Make sure the folder where you are running gulp has the user permission. else the permission will be denied
Hope this works for you
So I ran into this issue as well and none of the top answers were helping. Everything was installed, uninstalled, restarted, installed globally, etc., etc.... and still got the gulp command not found error. So I opened the package.json file and put in the following after the name field:
"scripts": {
"start": "gulp"
},
And then I ran npm start
in git bash.
Everything ran correctly, I got my dev view in my browser @ localhost and all was right with the world.
Hope this helps!