pdf2image icon indicating copy to clipboard operation
pdf2image copied to clipboard

Can't resolve 'spawn-sync'

Open adamhalasz opened this issue 1 year ago • 1 comments

Describe the bug When I import fromBuffer from pdf2pic and launch my app it shows this error:

Module not found: Can't resolve 'spawn-sync' in '/Users/adam/github/my_app/app/node_modules/.pnpm/[email protected]/node_modules/cross-spawn'

Import trace for requested module:
./node_modules/.pnpm/[email protected]/node_modules/cross-spawn/index.js
./node_modules/.pnpm/[email protected]/node_modules/gm/lib/compare.js
./node_modules/.pnpm/[email protected]/node_modules/gm/index.js
./node_modules/.pnpm/[email protected]/node_modules/pdf2pic/dist/index.js
./src/app/lib/utils/pdftopic.ts

To Reproduce Steps to reproduce the behavior:

import { fromBuffer } from "pdf2pic";

Expected behavior It should not show an error.

Environment;

  • OS: macOS Ventura 13.1 (Apple M1 Pro)
  • pdf2pic version ^3.1.3
  • graphicsmagick/imagemagick version: 1.3.45 2024-08-27
  • ghostscript version: 10.04.0
  • Node.js: v22.5.1
  • Next.js: 14.1.0

adamhalasz avatar Oct 24 '24 13:10 adamhalasz

Hi @adamhalasz,

Do you still face this issue?

cross-spawn is a dependency from gm, it should be installed and available. You can run npm ls cross-spawn to see if it's installed or not.

mskec avatar Jan 24 '25 18:01 mskec