0

I installed Gulp.js globally with Yarn:

$ yarn global add gulp --no-bin-links
yarn global v1.17.3
[1/4] Resolving packages...
warning gulp > glob-watcher > anymatch > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning gulp > glob-watcher > anymatch > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
info fsevents@1.2.12: The platform "linux" is incompatible with this module.
info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "gulp@4.0.2" with binaries:
      - gulp
Done in 5.76s.
$ yarn global add gulp-cli --no-bin-links
yarn global v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.12: The platform "linux" is incompatible with this module.
info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "gulp-cli@2.2.0" with binaries:
      - gulp
Done in 1.60s.

(I'm using the --no-bin-links parameter to avoid this error: error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../semver/bin/semver' -> '/path/to/project/public/components/accord/node_modules/.bin/semver'".)

The yarn global list provides the expected output:

$ yarn global list
yarn global v1.17.3
info "gulp@4.0.2" has binaries:
   - gulp
info "gulp-cli@2.2.0" has binaries:
   - gulp
Done in 0.53s.

But when I now execute gulp, old versions (Gulp 3.9.1 and Gulp CLI 2.2.0 are used:

$ gulp -v
CLI version: 2.2.0
Local version: 3.9.1

What is wrong here and how to install the required Gulp version globally correctly with Yarn and make this version be used?

RobC
  • 22,977
  • 20
  • 73
  • 80
automatix
  • 14,018
  • 26
  • 105
  • 230
  • Have you tried uninstalling gulp using npm (which I assume you used to install 3.9.1)? https://stackoverflow.com/a/44962536/3650835 – KayakinKoder Apr 17 '20 at 14:17
  • Thanks for your comment! Yes, before Yarn I used Gulp as npm package. Yes, tried to remove it, but ist not there anymore: `$ npm uninstall -g gulp` `->` `up to date in 0.04s`. (The same for Gulp CLI) And the package is actually not there anymore: `npm list -g | grep "gulp"` `->` `gulp-sourcemaps@1.6.0, gulp-choose-files@0.1.3`. – automatix Apr 17 '20 at 14:45
  • Hmm, I would remove all gulp artifacts (the v4 you added, cli, etc). Restart your computer. Doing `gulp -v` should then show gulp is not installed. Also note though that gulp can be installed locally in a project, so make sure you're in say a top level folder of your machine, not in a project that may have had gulp installed – KayakinKoder Apr 17 '20 at 17:13

0 Answers0