ceramicstudio / ceramic-ai

A realtime chat application using ComposeDB and OpenAI API
3 stars 2 forks source link

after running "npm run dev" i get this error when following the tutorial #2

Closed Shmoji closed 1 year ago

Shmoji commented 1 year ago

Going on the tutorial. After running "npm run dev" i get this error and cant continue:

[Ceramic]` Starting Ceramic node
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn npm',
  path: 'npm',
  spawnargs: [ 'run', 'ceramic' ]
}

I checked to make sure im using the correct node version and that it's installed at all - and all of that is good, so not sure what the deal is.

Shmoji commented 1 year ago

Finally figured part of it out after some tinkering.

Some notes:

I fixed it by editing run.mjs. I changed: const ceramic = spawn('npm', ["run", "ceramic"]); to this: const ceramic = spawn('C:/Program Files/nodejs/npm.cmd', ["run", "ceramic"]);

After that, I was able to get past the first error and now it is infinitely loading "[Ceramic] Starting Ceramic node".

Now it's saying 'CERAMIC_ENABLE_EXPERIMENTAL_COMPOSE_DB' is not recognized as an internal or external command, operable program or batch file....

So trying to figure that out now

Shmoji commented 1 year ago

i tried using WSL to fix this issue: 'CERAMIC_ENABLE_EXPERIMENTAL_COMPOSE_DB' is not recognized as an internal or external command, operable program or batch file. - but that didn't work.

So, i changed the package.json line 11 to this "ceramic": "SET CERAMIC_ENABLE_EXPERIMENTAL_COMPOSE_DB=true && ceramic daemon --config ./composedb.config.json", - that fixed the issue.

Then, i got this error: InvalidConnectionStringError: Invalid database connection string:.

Similar type of issue. To fix this i changed the 2 path strings in composedb.config.json by replacing all \\ with /.

After that, no more errors and everything finally worked! Sometimes the biggest blockers are the small annoying unrelated things lol