denoland / denokv

A self-hosted backend for Deno KV
https://deno.com/kv
MIT License
456 stars 21 forks source link

Node @deno/kv-darwin-x64 error #90

Open itsthesteve opened 1 month ago

itsthesteve commented 1 month ago

I don't see anyone else with this issue, but I cannot figure this one out.

I ran the install and test scripts from the docs page:

import { openKv } from "@deno/kv";

const kv = await openKv(":memory:");

// use the Deno KV api: https://deno.land/api?s=Deno.Kv&unstable
const key = ["users", crypto.randomUUID()];
const value = { name: "Alice" };
await kv.set(key, value);

const result = await kv.get(key);
console.log(result.value); // { name: "Alice" }

Results in the following error:

 node index.js                                                                                                                                                          1 ↵
node:internal/modules/cjs/loader:444
      const err = new Error(
                  ^

Error: Cannot find module '/Users/steve/Projects/web/_sandbox/deno-kv-node/node_modules/@deno/kv-darwin-x64/deno-kv-napi.darwin-x64.node'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:444:19)
    at Module._findPath (node:internal/modules/cjs/loader:715:18)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/Users/steve/Projects/web/_sandbox/deno-kv-node/node_modules/@deno/kv/esm/_napi_index.cjs:59:29)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/Users/steve/Projects/web/_sandbox/deno-kv-node/node_modules/@deno/kv-darwin-x64/package.json',
  requestPath: '@deno/kv-darwin-x64'
}

Node.js v20.10.0

Even tried manually installing @deno/kv-darwin-x64, but it's pretty empty.

So far I'm the only one from what search results I've found, but I'm stumped.