Я установил Gulp. js глобально с помощью пряжи:
$ 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.
(я использую параметр --no-bin-links
, чтобы избежать этой ошибки: error An unexpected error occurred: "EPROTO: protocol error, symlink '../../../semver/bin/semver' -> '/path/to/project/public/components/accord/node_modules/.bin/semver'"
.)
yarn global list
обеспечивает ожидаемый вывод:
$ 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.
Но когда я сейчас выполняю gulp
, используются старые версии (Gulp 3.9.1
и Gulp CLI 2.2.0
:
$ gulp -v
CLI version: 2.2.0
Local version: 3.9.1
Что здесь не так и как правильно установить требуемую версию Gulp с помощью Yarn и , чтобы эта версия использовалась?