43

I am using ubuntu 14.04 LTS, I have nodejs (not node) and npm installed. I had installed gulp using npm install gulp -g.

But my command gulp does not work, it runs silently returning nothing!

enter image description here

Preview
  • 35,317
  • 10
  • 92
  • 112
Dipendra Gurung
  • 5,720
  • 11
  • 39
  • 62

6 Answers6

40

I ran into the same problem today on Ubuntu 14.04 LTS. After debugging I noticed that I had accidentally installed nodejs and node using apt-get. After running

sudo apt-get remove node

the problem was fixed.

Hope this helps.

jmw327
  • 409
  • 4
  • 2
  • 2
    Worked for me after following RaphDG, daniels, then jmw327 response's in that order! TY. – djfrsn Aug 16 '15 at 19:38
  • 2
    gulp needs node (`#!/usr/bin/env node`) so how can removing it solve the problem? Can you explain this a bit more? If I follow this advice I quite rightly get `/usr/bin/env: node: No such file or directory` – Burhan Ali Mar 09 '16 at 15:07
  • 1
    Never mind. I found the answer: http://stackoverflow.com/questions/21168141/cannot-install-packages-using-node-package-manager-in-ubuntu – Burhan Ali Mar 09 '16 at 15:24
34

Try linking the nodejs executable to node in the same path.

Something like:

sudo ln -s /usr/bin/nodejs /usr/bin/node

Depending on where your node executable is. You can find out with

which nodejs
RaphDG
  • 1,351
  • 10
  • 17
21

On my side, same symptom. What was missing is th CLI part of gulp:

sudo npm install --global gulp-cli
gdupont
  • 1,660
  • 18
  • 27
  • You must not use "sudo" while installing any package, as it creates problems,....try it without sudo! – Ankur Shah Jan 09 '17 at 10:43
  • 4
    Worked for me with `sudo`. Without `sudo` it says `npm ERR! Please try running this command again as root/Administrator.` – Max Yudin Apr 20 '17 at 17:07
17

When you have these kind of problem, my advice is to reinstall the module :

npm un -g gulp && npm un gulp
npm i -g gulp
npm i --save-dev gulp

These commands uninstall all gulp modules in local and global.

After, it installs gulp in global to use it in the command line, and in your local modules, because gulp needs it as well.

Etienne
  • 655
  • 3
  • 15
2

You can Install gulp by using terminal(npm install -g gulp). But best way is use Synaptic Package Manager. This is old Software installer of Ubuntu. but now Ubuntu Introduce Ubuntu Software Center.

Cz of I recommended Synaptic is when you install some software it will download some of helpers too. Ex if you want download gulp(Node.js) in search type node.js. It will show some other apps too. Select all and click apply.

  1. To download Synaptic

    • sudo apt-get install synaptic
  2. To install Node.js too.

  3. To check node version

    • node --version
  4. To run gulp, Go to the directory and just type gulp.

It will load all your project


Update 2017-10-14

To install complete node, follow these

  1. Remove node(if exist) sudo apt-get remove nodejs Check this as well
  2. Remove npm(if exist) sudo apt-get remove npm
  3. Clean sudo apt-get autoremove
  4. sudo apt-get update
  5. sudo apt-get install nodejs
  6. sudo apt-get install npm

now check command gulp

`

Abdulla Nilam
  • 36,589
  • 17
  • 64
  • 85
0

even after uninstalling and installing nodejs and npm kept getting "/usr/bin/env: ‘node’: No such file or directory"

so i checked the node version (not nodejs): node -v got "The program 'node' is currently not installed. You can install it by typing: sudo apt install nodejs-legacy"

so i did install it: sudo apt install nodejs-legacy

and gulp works fine.