Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canvas Peer dependency issue on npm install #1586

Open
tr1stan opened this issue Jan 14, 2025 · 3 comments
Open

canvas Peer dependency issue on npm install #1586

tr1stan opened this issue Jan 14, 2025 · 3 comments

Comments

@tr1stan
Copy link

tr1stan commented Jan 14, 2025

Bug Report

Description of the problem

npm install on fresh checkout gives me a conflicting peer dependency on [email protected] vs [email protected]

Using npm install --legacy-peer-deps gets around the issue.

Steps to reproduce

  1. git clone https://github.com/foliojs/pdfkit.git
  2. cd pdfkit
  3. npm install

Error:

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/canvas
npm error   dev canvas@"^3.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peerOptional canvas@"^2.5.0" from [email protected]
npm error node_modules/jest-environment-jsdom
npm error   dev jest-environment-jsdom@"^29.7.0" from the root project
npm error
npm error Conflicting peer dependency: [email protected]
npm error node_modules/canvas
npm error   peerOptional canvas@"^2.5.0" from [email protected]
npm error   node_modules/jest-environment-jsdom
npm error     dev jest-environment-jsdom@"^29.7.0" from the root project

Your environment

  • pdfkit version: master
  • Node version: v22.13.0 (npm v10.9.2)
  • Operating System: macOS Sonoma 14.6.1
@tr1stan
Copy link
Author

tr1stan commented Jan 14, 2025

Turns out that yarn install works fine without the dep issues (having noticed the yarn.lock file) - So does this mean that a switch from npm to yarn has happened without the docs being updated?

@blikblum
Copy link
Member

Yes. Docs should be updated

@williamdlees
Copy link

I don't think this fixes the issue, though. When I ran yarn I received a similar report. For the time being I have changed the requirement in package.json to "canvas": "^2.5.0" and things seem to be running.

`d:\Research\pdfkit>yarn install
➤ YN0087: Migrated your project to the latest Yarn version 🚀

➤ YN0000: · Yarn 4.6.0
➤ YN0000: ┌ Resolution step
➤ YN0085: │ + @babel/core@npm:7.26.0, @babel/plugin-external-helpers@npm:7.25.9, and 841 more.
➤ YN0000: └ Completed in 4s 383ms
➤ YN0000: ┌ Post-resolution validation
➤ YN0060: │ canvas is listed by your project with version 3.0.0 (p9737c), which doesn't satisfy what jest-environment-jsdom and other dependencies request (^2.5.0).
➤ YN0086: │ Some peer dependencies are incorrectly met by your project; run yarn explain peer-requirements for details, where is the six-letter p-prefixed code.
➤ YN0000: └ Completed
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 842 packages were added to the project (+ 148.73 MiB).
➤ YN0000: └ Completed in 4s 999ms
➤ YN0000: ┌ Link step
➤ YN0007: │ canvas@npm:3.0.0 must be built because it never has been before or the last one failed
➤ YN0007: │ es5-ext@npm:0.10.64 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 8s 192ms
➤ YN0000: · Done with warnings in 17s 718ms`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants