aristanetworks / purescript-backend-optimizer

Optimizing backend toolkit and modern ECMAScript backend for PureScript
MIT License
201 stars 18 forks source link

spawn esbuild ENOENT #104

Open JohnGurin opened 7 months ago

JohnGurin commented 7 months ago
> pnpm exec purs-backend-es bundle-module --no-build

node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: spawn esbuild ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn esbuild',
  path: 'esbuild',
  spawnargs: [
    '--platform=browser',
    '--format=esm',
    '--outfile=index.js',
    '--bundle',
    'C:\\Users\\John\\Documents\\purescript-2\\output-es\\Main\\index.js'
  ]
}
> pnpm ls

dependencies:
esbuild 0.20.2
purescript 0.15.15
purs-backend-es 1.4.2
spago 0.21.0

The same with npm install and npm instal --global. pnpm exec spago build works and output-es folder exists.

natefaubion commented 7 months ago

Does output-es/Main/index.js exist? Do you have a Main module?

jmmaa commented 4 months ago

Same issue here

mister-what commented 2 months ago

It looks like esbuild should be listed as either a dependency or, ideally, a peer dependency of purs-backend-es. To address this locally, you can manually install esbuild in your project using the following command:

npm install -D esbuild

However, this issue should be resolved directly within this project to prevent others from encountering the same problem. Would it be possible to update the package to include esbuild as a peer dependency?

natefaubion commented 2 months ago

The original ticket notes that esbuild is installed.