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

Node child_process throws ENOENT after upgrade to 0.6.0 #35

Closed
jordojordo opened this issue May 10, 2024 · 0 comments · Fixed by #36
Closed

Node child_process throws ENOENT after upgrade to 0.6.0 #35

jordojordo opened this issue May 10, 2024 · 0 comments · Fixed by #36

Comments

@jordojordo
Copy link
Contributor

jordojordo commented May 10, 2024

This error message is being returned for any method of the Client class:

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

Error: spawn /usr/src/app/node_modules/@gptscript-ai/gptscript/bin/gptscript 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: -2,
  code: 'ENOENT',
  syscall: 'spawn /usr/src/app/node_modules/@gptscript-ai/gptscript/bin/gptscript',
  path: '/usr/src/app/node_modules/@gptscript-ai/gptscript/bin/gptscript',
  spawnargs: [
    '--events-stream-to=fd://3',
    '--chat-state=null',
    '/usr/src/app/dist/modules/KubeScriptExecutor/tool.gpt',
    {
...

I have tried on multiple machines, different node versions, and even within a container running the node image. This issue didn't appear until I upgraded to 0.6.0 and refactored things to match the new Client class.


Workaround

Set the GPTSCRIPT_BIN env to the proper location: node_modules/@gptscript-ai/bin/gptscript

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

Successfully merging a pull request may close this issue.

1 participant