I added Gulp.js v4
to the project's dependencies and ran yarn install --no-bin-links
to install locally.
$ yarn install --no-bin-links
yarn install 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 Saved lockfile.
Done in 32.48s.
(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 package.json
defines the correct version ranges:
{
...
"dependencies": {
"bootstrap": "^3.3.6",
"gulp": "^4.0.2",
"gulp-autoprefixer": "*",
"gulp-cli": "^2.2.0",
"gulp-filter": ">=6.0.0",
"gulp-less": "*",
"gulp-plumber": "*",
"gulp-rename": "*",
"gulp-watch": "*",
"html5shiv": ">=3.7.3",
"jquery": "^3.4.0",
"jquery-ui": "^1.12.1",
"jquery-ui-dist": "^1.12.1",
"path": "*",
"respond": ">=0.9.0"
},
...
}
The yarn.lock
also refers the correct version:
...
gulp@^4.0.2:
version "4.0.2"
...
gulp-cli@>=2.2.0, gulp-cli@^2.2.0:
version "2.2.0"
...
And also the yarn list
provides the expected output:
$ yarn list | grep "gulp"
├─ gulp-autoprefixer@7.0.1
├─ gulp-cli@2.2.0
│ ├─ gulplog@^1.0.0
├─ gulp-filter@6.0.0
├─ gulp-less@4.0.1
├─ gulp-plumber@1.2.1
├─ gulp-rename@2.0.0
├─ gulp-watch@5.0.1
├─ gulp@4.0.2
│ ├─ gulp-cli@^2.2.0
├─ gulplog@1.0.0
But when I now execute gulp
, old versions (Gulp 3.9.1
and Gulp CLI 1.2.1
are used:
$ ./public/components/gulp/bin/gulp.js -v
[15:42:30] CLI version 1.2.1
[15:42:30] Local version 3.9.1
What is wrong here and how to install the required Gulp version locally correctly with Yarn and make this version be used?