surrealdb / surrealdb.node

A Node.js engine for the SurrealDB JavaScript SDK
https://surrealdb.com
Apache License 2.0
59 stars 10 forks source link

Unable to install (error Couldn't find package "surrealdb.node-win32-arm64-msvc@0.2.0") #14

Open CanRau opened 11 months ago

CanRau commented 11 months ago

yarn add surrealdb.node results in the following error

error Couldn't find package "surrealdb.node-win32-arm64-msvc@0.2.0" required by "surrealdb.node" on the "npm" registry.

I'm on macOS Big Sur (11.7.10) and unfortunately can't upgrade due to 3rd party ssd 🥲

Anything I can do? I wan't to embed ideally via file (I guess RocksDB) and potentially memory

Update: just in case this happens using yarn 1.22.19

CanRau commented 9 months ago

Any chance someone could help me figure this out? 😇

CanRau commented 9 months ago

Got it working with RocksDB 🥳

  1. Clone into yarn workspace
  2. yarn install within surrealdb.node dir
  3. changed Cargo.toml to
    
    [package]
    name = "surrealdb_node"
    version = "0.4.0"
    edition = "2021"

[lib] crate-type = ["cdylib"]

[dependencies] dmp = "0.2.0" napi = { version = "2", features = ["async", "serde-json"] } napi-derive = "2" serde = "1.0.188" serde_json = "1.0.105" surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }

[build-dependencies] napi-build = "2.0.1"

[features] rocksdb = ["surrealdb/kv-rocksdb"]

[profile.release] lto = true

[target.x86_64-pc-windows-msvc.dependencies]

surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }

[target.x86_64-unknown-linux-gnu.dependencies]

surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }

[target.aarch64-linux-android.dependencies]

surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }

[target.armv7-linux-androideabi.dependencies]

surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }

[target.aarch64-apple-darwin.dependencies] surrealdb = { version = "1.0.0", features = ["kv-mem", "kv-rocksdb"] }


4. `yarn build` in `surrealdb.node` dir
5. add `"surrealdb.node": "0.4.0"` to main project's `package.json`
6. `yarn install` in project root
7. `yarn dev` 🚀 
CanRau commented 9 months ago

Now I'm wondering why those lines where disabled, anything I should watch out for? Tho in production it would build and run on Linux

MountainAndMorning commented 8 months ago

Has development of this library been discontinued?

MountainAndMorning commented 8 months ago

Thanks for your help. I follow your step to install surrealdb.node on my Macbook Air with M2 chip. Everything is OK. However, when I run the official example, as below, I encounter this error: [Error: Select either namespace or database to use] error at the line await db.use({ ns: "test", db: "test" });.

import {Surreal} from 'surrealdb.node';
const {Surreal} = require('surrealdb.node');

const db = new Surreal();

// use in-memory database
await db.connect('memory');

// Select a specific namespace / database
await db.use({ ns: "test", db: "test" });

// Create a new person with a random id
let created = await db.create("person", {
    title: "Founder & CEO",
    name: {
        first: "Tobie",
        last: "Morgan Hitchcock",
    },
    marketing: true,
    identifier: Math.random().toString(36).substr(2, 10),
});
CanRau commented 8 months ago

I hope and don't think it has been discontinued just too many other priorities are the moment I guess 🥲

Though I'm also desperately waiting for it to continue & improve 🥹

Sorry can't help you as I never continued my experiments, would prefer official support 😇

CanRau commented 8 months ago

Okay so the installation problem, at least in my case, was due to yarn v1, as I switched our project to pnpm couple of days ago I just tried again and installation worked though I think rocksdb might not work, also deployed in Docker didn't seem to work on first try, so I'm still desperately waiting for nodejs embedded surrealdb to advance 😇

alexgorbatchev commented 8 months ago

Looks like this issue is being ignored... I "fixed" this by publishing the missing surrealdb.node-linux-arm-gnueabihf and surrealdb.node-win32-arm64-msvc as blank packages to prevent install errors. Cheers.

kearfy commented 8 months ago

Hey @alexgorbatchev and @CanRau, so sorry for the late response here! I've mainly been very busy which is unfortunately holding me back from fixing these issues. I will be focusing on some welcome improvements to the JS ecosystem the coming time again and will also make sure to tackle this issue!

CanRau commented 8 months ago

Hey @kearfy thanks for the heads up really appreciated 🙌🏼 Just to understand the situation a little better do you have a rough estimate on when you'll have the time to work on surrealdb.node? Like next week, month, later or unknown? 😇

nottisa commented 5 months ago

The issue I'm having seems to be similar.

Error: node_modules/surrealdb.node-linux-x64-gnu/surrealdb.node.linux-x64-gnu.node: undefined symbol: __libc_single_threaded
    at Module._extensions..node (node:internal/modules/cjs/loader:1473:18)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/workspaces/User-API/node_modules/surrealdb.node/index.js:190:31)
    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)
    at Module._load (node:internal/modules/cjs/loader:1023:12) {
  code: 'ERR_DLOPEN_FAILED'
}

(Linux)