delucis / astro-netlify-cms

Integration to add Netlify CMS’s admin dashboard to any Astro project
160 stars 22 forks source link

Error: spawn netlify-cms-proxy-server ENOENT on "astro dev #55

Open techguysimon opened 1 year ago

techguysimon commented 1 year ago

I'm getting the following error on astro dev.

Running Mac Os Ventura PNPM is my package manager



  🚀  astro  v1.7.2 started in 333ms

  ┃ Local    http://localhost:3000/
  ┃ Network  use --host to expose

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

Error: spawn netlify-cms-proxy-server ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476: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:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn netlify-cms-proxy-server',
  path: 'netlify-cms-proxy-server',
  spawnargs: []
}

Node.js v18.12.1
 ELIFECYCLE  Command failed with exit code 1.```
jeremy-london commented 1 year ago

Same issue here: "astro-netlify-cms": "^0.5.1",

  🚀  astro  v1.9.2 started in 238ms

  ┃ Local    http://localhost:3000/
  ┃ Network  use --host to expose

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

Error: spawn netlify-cms-proxy-server ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476: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:289:12)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn netlify-cms-proxy-server',
  path: 'netlify-cms-proxy-server',
  spawnargs: []
}

Node.js v18.13.0
 ELIFECYCLE  Command failed with exit code 1.
delucis commented 1 year ago

Thanks for the reports! What package manager & OS are you using @jeremy-london?

jeremy-london commented 1 year ago

@delucis

Apple M2 if it matters

Mac OS Ventura 13.1
pnpm 7.22.0
node 18.13.0
astro-netlify-cms 0.5.1

I found I can run a proxy server no issue outside of the astro-netlify package, but during startup inside astro's engine this spawn process doesnt work all the way: pnpx netlify-cms-proxy-server

wasim7raja10 commented 11 months ago

I got this same error. I am not sure about the solution.

Sharing the link here so that anyone can take a look and understand what's happening

https://maxschmitt.me/posts/error-spawn-node-enoent-node-js-child-process

zanhk commented 10 months ago

Hi is there any update on this issue? I'm using pnpm as well

stephangriesel commented 7 months ago

Yep also getting the same, using pnpm 8.7.0.: "astro": "3.0.3" "astro-netlify-cms": "^0.5.2",

yicone commented 7 months ago

I modified the source code locally, and now it's working.

./node_modules/astro-netlify-cms/dist/index.js

- proxy = spawn('netlify-cms-proxy-server', { 
+ proxy = spawn('pnpx', ['netlify-cms-proxy-server'], {
    stdio: 'inherit',
    // Run in shell on Windows to make sure the npm package can be found.
    shell: process.platform === 'win32',
});
pnpm 8.7.5
node v18.17.1
astro-netlify-cms 0.5.4
stephangriesel commented 7 months ago
proxy = spawn('pnpx', ['netlify-cms-proxy-server'], {

This also worked for me