denoland / denokv

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

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

Open itsthesteve opened 3 months ago

itsthesteve commented 3 months 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.

Schweinepriester commented 1 month ago

We also have this issue, blocking our devs on Intel Macs.

0.8.x is indeed

pretty empty

see

Downgrading to 0.7.0 mitigates for now for us, as there the relevant deno-kv-napi.darwin-x64.node is still present: https://www.npmjs.com/package/@deno/kv-darwin-x64/v/0.7.0?activeTab=code

EDIT:

Nope, downgrading doesn't mitigate, because there appears to be a breaking change going back to 0.7.0.

Schweinepriester commented 2 weeks ago

https://www.npmjs.com/package/@deno/kv-darwin-x64/v/0.8.4?activeTab=code

is empty as well