Gulp installing wrong version. Need 3.9.1 but keeps installing 4.0.2

Despite trying everything I know how to do and doing a ton of searching I cannot figure out what is wrong. I am trying to launch an older project in docker. The package.json file is set to install [email protected] but when the Dockerbuild runs and installs the packages it installs 4.0.2 every time.

How can I get my docker image to install the correct version of gulp?

Dockerfile

WORKDIR /var/www

#Install Node and NPM
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt update
RUN apt install -y nodejs lsof

#Install NPM deps
COPY ./package-lock.json /var/www/package-lock.json
COPY ./package.json /var/www/package.json
RUN npm install --quiet >> /dev/null 
    && npm link gulp 
    && gulp -v

package.json

"devDependencies": {
    "gulp": "^3.9.1",
}

package-lock.json

"gulp": {
  "version": "3.9.1",
  "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz",
  "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=",
  "dev": true,
  "requires": {
    "archy": "^1.0.0",
    "chalk": "^1.0.0",
    "deprecated": "^0.0.1",
    "gulp-util": "^3.0.0",
    "interpret": "^1.0.0",
    "liftoff": "^2.1.0",
    "minimist": "^1.1.0",
    "orchestrator": "^0.3.0",
    "pretty-hrtime": "^1.0.0",
    "semver": "^4.1.0",
    "tildify": "^1.0.0",
    "v8flags": "^2.0.2",
    "vinyl-fs": "^0.3.0"
  },
  "dependencies": {
    "semver": {
      "version": "4.3.6",
      "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz",
      "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=",
      "dev": true
    }
  }
},

Docker Build output

Step 12/20 : RUN npm install --quiet >> /dev/null     && npm link gulp     && gulp -v
 ---> Running in 8dc99b37ab8a

/usr/bin/gulp -> /usr/lib/node_modules/gulp/bin/gulp.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/gulp/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 314 packages from 217 contributors in 16.348s
/var/www/node_modules/gulp -> /usr/lib/node_modules/gulp
CLI version: 2.2.0
Local version: 4.0.2

Source: StackOverflow