ianmacartney / embeddings-in-convex

An example of working with embeddings in Convex.
18 stars 2 forks source link

Upload sources from a folder script command doesn't work #1

Open Derick1530 opened 1 year ago

Derick1530 commented 1 year ago

Upload sources from a folder

npx ts-node-esm scripts/addFiles.ts ./path/to/folder

THis command doesn't work. here is the error returned when execute:

node:internal/modules/cjs/loader:995
  const err = new Error(message);
              ^

Error: Cannot find module './addFiles.ts'
Require stack:
- /home/razac/Documents/GitHub/embeddings-in-convex/script/imaginaryUncacheableRequireResolveScript
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Function.resolve (node:internal/modules/cjs/helpers:109:19)
    at requireResolveNonCached (/home/razac/.nvm/versions/node/v18.12.1/lib/node_modules/ts-node/dist/bin.js:549:16)
    at getProjectSearchDir (/home/razac/.nvm/versions/node/v18.12.1/lib/node_modules/ts-node/dist/bin.js:519:40)
    at phase3 (/home/razac/.nvm/versions/node/v18.12.1/lib/node_modules/ts-node/dist/bin.js:267:27)
    at bootstrap (/home/razac/.nvm/versions/node/v18.12.1/lib/node_modules/ts-node/dist/bin.js:47:30)
    at Object.<anonymous> (/home/razac/.nvm/versions/node/v18.12.1/lib/node_modules/ts-node/dist/child/child-entrypoint.js:23:21)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/razac/Documents/GitHub/embeddings-in-convex/script/imaginaryUncacheableRequireResolveScript'
  ]
}

Node.js v18.12.1

OR

 Need to install the following packages:
  ts-node-esm@0.0.6
Ok to proceed? (y) y
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name ">=^3.9.3" of package "typescript@>=^3.9.3": Tags may not have any characters that encodeURIComponent encodes.
ianmacartney commented 1 year ago

Are you running it from the repo root? Cannot find module './addFiles.ts' seems suspicious since there is a file scripts/addFiles.ts. I will admit I'm not an expert in ts-node-esm so it might take some googling to figure out why it isn't installing correctly. I just got it working. The code is relatively straightforward if you have a better way of running node.js code locally.

Derick1530 commented 1 year ago

I also got it working but in my nextjs app.

On Fri, Sep 8, 2023 at 3:03 AM Ian Macartney @.***> wrote:

Are you running it from the repo root? Cannot find module './addFiles.ts' seems suspicious since there is a file scripts/addFiles.ts. I will admit I'm not an expert in ts-node-esm so it might take some googling to figure out why it isn't installing correctly. I just got it working. The code is relatively straightforward if you have a better way of running node.js code locally.

— Reply to this email directly, view it on GitHub https://github.com/ianmacartney/embeddings-in-convex/issues/1#issuecomment-1710904447, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOYCTR2FGE5DRTHHB3QJVE3XZJOE3ANCNFSM6AAAAAA4PH3CEE . You are receiving this because you authored the thread.Message ID: @.***>