mozilla / pdf.js

PDF Reader in JavaScript
https://mozilla.github.io/pdf.js/
Apache License 2.0
47.17k stars 9.82k forks source link

Unsupported gulp version #18232

Closed DerIngo closed 3 weeks ago

DerIngo commented 3 weeks ago

I followed the "Getting the Code" on https://github.com/mozilla/pdf.js When I tried to start the server with gulp server, I got an error message: Unsupported gulp version. I could fix it when I changed in package.json from "gulp": "^5.0.0" to "gulp": "4.0.0"

PS: In the Learning-Section you have an introduction video, which might be a little outdated (12 years old).

DerIngo commented 3 weeks ago

Maybe the issue is a few lines earlier, when the guide tells me npm install -g gulp-cli@^2.3.0. Maybe this should be npm install -g gulp-cli@^3.0.0?

timvandermeij commented 3 weeks ago

gulp server only works if Gulp 5 is installed globally, which should no longer be done because global dependencies are harder to manage. It's better to use npx gulp server instead which ensures that the local dependency version is used. If you have Gulp installed globally, you should uninstall it first.

Note the following sentence in the "Getting the Code" section:

If you prefer to not install gulp-cli globally, you have to prefix all the gulp commands with npx (for example, npx gulp server instead of gulp server).

timvandermeij commented 3 weeks ago

Looking at this again, we should indeed amend the README after https://github.com/mozilla/pdf.js/commit/98ef8a1be3592042798ae55afffe4c0c39bd8247. Thank you and @qwer1304 for reporting this; I've created a PR that should resolve the issue.

timvandermeij commented 3 weeks ago

Fixed by #18247.