Reputation: 3598
I have installed gulp
both globally
sudo npm install --global gulp-cli
and locally
npm install --save-dev gulp
/usr/local/bin/gulp
exists, and ./node_modules/gulp
and ./node_modules/gulp-cli
exist.
When I try to run gulp
on the command line, I get the common error
$ gulp
[00:55:43] Local gulp not found in ~/dev/myProj/play-java-seed
[00:55:43] Try running: npm install gulp
One thing that I noticed is that if I run gulp
in some random directory (~/foo), the error message is that the local gulp is not found in that directory. If I run it from the correct directory (~/dev/myProj/play-java-seed/ui) then the error references the parent directory.
There is in fact no gulp installed in the directory in the error message; it is installed on directory lower.
/usr/local/bin/gulp
is a symlink to a file with these contents:
#!/usr/bin/env node
'use strict';
require('../')();
Is the ..
in that file correct? It seems strange, but I have not looked at it closely before.
If the OS matters, I am running 32 bit Ubuntu 16.04.
devDependencies
in my package.json
includes both gulp
and gulp-cli
Upvotes: 4
Views: 10485
Reputation: 3598
Rico Kahler had the correct answer in his comment.
When I looked at the machine (instead of going off of my memory), I saw that the gulp file was one directory higher than it should have been.
The error message did have a clue toward this: it gave the directory holding the gulpfile, not the current directory.
Upvotes: 5