1

After reading around 20 posts about gulp not found issues, I am still stuck with this and am clueless now. The installation with npm seems so easy though. I am simply trying to install gulp on Ubuntu 18.04 and use it in my project. But it seems the project and my entire laptop is incapable of finding it after successful installation.

Cleaning

I tried to remove everything regarding node, nodejs, npm and any node_modules folder. Then was using find command to make sure all of it had been deleted. I basically used:

sudo apt-get purge --auto-remove nodejs

And I copied the commands of this website

Installation

Here is what I did several times:

sudo apt-get install node //using the specific node version 10.x

Then the following to make sure this was properly installed:

$ node -v
v10.16.3
$ npm -v
6.9.0

Finally I try to install gulp, and read that gulp-cli was needed:

sudo npm install -g gulp-cli
sudo npm install -g gulp

Then I went into my project folder where package.json is and did:

npm install gulp
gulp -v

The result is always the same:

Command 'gulp' not found, but can be installed with:
sudo apt install gulp

I haven't seen anywhere recommendations of using sudo apt install gulp but maybe I should try.

Thank you for the help.

Alexandre
  • 105
  • 1
  • 6

2 Answers2

0

You can try the below command for installation.

npm install --global gulp-cli

or

$ npm uninstall --global gulp gulp-cli
$ rm /usr/local/share/man/man1/gulp.1
$ npm install --global gulp-cli
Pushprajsinh Chudasama
  • 7,772
  • 4
  • 20
  • 43
0

Ok it seems my issue was related to permissions and sudo usage, which I knew could be risky but it seems I didn't manage to avoid it everywhere.

After doing a full cleaning with

sudo apt-get purge --auto-remove nodejs

and removing all node_modules folders again, including /home/<myname>/.npm_global, I tried again without any sudo (except to install nodejs). Here is what worked for me:

sudo apt install nodejs
npm install --global gulp // not sure this was needed
npm install --global gulp-cli
cd <my project folder>
npm install gulp
Alexandre
  • 105
  • 1
  • 6