0

I am trying to set up the needed environment for a project I am gonna work on. I am not able to run gulp command as expected (as it is told on the getting started page of Gulp). I am using Linux (PopOS) which is based on Ubuntu and Debian.

So, I have tried to fix it in the local project repo - which was unsuccessful.

Then I decided to create a new project directory and see whether it works. I have done these in the new project file:

$ node -v
v8.10.0

$ npm -v
5.6.0

$ npx -v
9.7.1

$ npm install --global gulp-cli
$ npm install --save-dev gulp

After all these, at the last step, when I do:

$ gulp
-bash: /usr/bin/gulp: No such file or directory

this is what I get.

However, if I do this,

$ node_modules/gulp/bin/gulp.js --version
CLI version: 2.2.0
Local version: 4.0.2

I get some result.

Does anybody see why gulp isn't getting in my binary directory? - Even though I have done the same exact steps that are presented on the official website?

dugong
  • 3,690
  • 4
  • 11
  • 27
  • Might your problem be addressed here: `https://stackoverflow.com/questions/54986239/gulp-usr-local-bin-gulp-no-such-file-or-directory?rq=1` ? –  Jul 26 '19 at 20:41
  • What does `ldd /usr/bin/gulp` say? –  Jul 26 '19 at 20:54
  • Does `gulp -v` do anything? – Mark Jul 26 '19 at 22:36
  • `ldd /usr/bin/gulp` gives `No such file or directory` @Roadowl `gulp -v` says Command `gulp` not found. @Mark The problem is, `gulp-cli` is not being installed globally somehow. – dugong Jul 29 '19 at 14:39
  • @Roadowl thanks for the reference to the other question. It is actually the same problem but I am using Linux as OS, so I thought my problem might be related to something else. `npx gulp` (which is mentioned in that question) works for me too, but the reason why I should use `npx` and cannot simply run the command `gulp` after doing the steps on official site is remaining unknown. – dugong Jul 29 '19 at 14:43
  • I cannot square `-bash: /usr/bin/gulp: No such file or directory`, where somehow a complete path is given, with `ldd /usr/bin/gulp No such file or directory`. –  Aug 10 '19 at 00:52
  • What do `type gulp` and `ls -la /usr/bin/gulp` say? –  Aug 10 '19 at 00:53

1 Answers1

0

This issue was about npm prefix that defines the directory where npm packages will be installed. Because the gulp binary wasn't in one of the directories that is in PATH variable bash wasn't able to find it. Here you can find details about how to fix.

dugong
  • 3,690
  • 4
  • 11
  • 27