23

I try install gulp in mac like this :

Is-iMac:~ itop$ npm root
/Users/itop/node_modules
Is-iMac:~ itop$ npm config set prefix /usr/local
Is-iMac:~ itop$ npm root -g
/usr/local/lib/node_modules
Is-iMac:~ itop$ sudo npm install -g gulp

After Install I see this error In terminal:

npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "gulp"
npm ERR! node v5.6.0
npm ERR! npm  v3.8.0
npm ERR! path /usr/local/bin/gulp
npm ERR! code EEXIST

npm ERR! Refusing to delete /usr/local/bin/gulp: ../lib/node_modules/gulp-cli/bin/gulp.js symlink target is not controlled by npm /usr/local
npm ERR! File exists: /usr/local/bin/gulp
npm ERR! Move it away, and try again.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/it/npm-debug.log

Now when i type gulp for start/run in terminal i see this error:

-bash: gulp: command not found

EDIT: I try with this comment By archie-voyageur:

npm install --global gulp-cli

And See this error:

/usr/local/bin/gulp -> /usr/local/lib/node_modules/gulp-cli/bin/gulp.js
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--global" "gulp-cli"
npm ERR! node v5.6.0
npm ERR! npm  v3.8.0
npm ERR! path /usr/local/share/man/man1/gulp.1
npm ERR! code EEXIST

npm ERR! Refusing to delete /usr/local/share/man/man1/gulp.1: ../../../lib/node_modules/gulp/gulp.1 symlink target is not controlled by npm /usr/local
npm ERR! File exists: /usr/local/share/man/man1/gulp.1
npm ERR! Move it away, and try again.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/itop/npm-debug.log

How do fix this?

Community
  • 1
  • 1
ಠ_ಠ
  • 1,235
  • 2
  • 17
  • 29

5 Answers5

83

Just came across this issue myself and managed to solve it with:

$ npm uninstall --global gulp gulp-cli
$ rm /usr/local/share/man/man1/gulp.1
$ npm install --global gulp-cli
binz
  • 1,025
  • 8
  • 9
8

go to

cd /usr/local/bin
ls -las

if gulp is present delete that directory. (sudo rm -rf gulp) reinstall gulp-cli

===================================================================

if it is not working uninstall node, npm completely and try again

follow this link for step by step guide

node and npm uninstall step by step

VPC
  • 81
  • 2
0

I think you have gulp installed in your system, or at least you have some files related to gulp. Just do npm uninstall --global gulp gulp-cli and then try to install it again with npm install --global gulp-cli. If this doesn't work, I don't know what is happening on your system.

franmartosr
  • 378
  • 1
  • 5
  • 10
  • The only thing coming to my head that you could do is unistall Node from your system and install it from scratch again. But I don't have much hope about that becuase I don't know what is cuasing your problem. – franmartosr Mar 09 '16 at 12:58
0

After pulling my hair out trying all of these, I ended up being able to install stupid gulp by doing

npm uninstall --global gulp gulp-cli

yarn global add gulp
Dharman
  • 30,962
  • 25
  • 85
  • 135
-1

For me it worked only when I installed gulp using npm instead of yarn. Very weird..

Omer Levi Hevroni
  • 1,935
  • 1
  • 15
  • 33