astro-netlify-cms icon indicating copy to clipboard operation
astro-netlify-cms copied to clipboard

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

Open techguysimon opened this issue 2 years ago • 8 comments
trafficstars

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.```

techguysimon avatar Dec 26 '22 23:12 techguysimon

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.

jeremy-london avatar Jan 17 '23 01:01 jeremy-london

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

delucis avatar Jan 17 '23 12:01 delucis

@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

jeremy-london avatar Jan 17 '23 14:01 jeremy-london

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

wasim7raja10 avatar Aug 14 '23 13:08 wasim7raja10

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

zanhk avatar Sep 11 '23 12:09 zanhk

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

stephangriesel avatar Nov 27 '23 05:11 stephangriesel

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

yicone avatar Nov 28 '23 09:11 yicone

proxy = spawn('pnpx', ['netlify-cms-proxy-server'], {

This also worked for me

stephangriesel avatar Nov 30 '23 05:11 stephangriesel