Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install (error Couldn't find package "[email protected]") #14

Open
CanRau opened this issue Oct 5, 2023 · 11 comments
Open

Comments

@CanRau
Copy link

CanRau commented Oct 5, 2023

yarn add surrealdb.node results in the following error

error Couldn't find package "[email protected]" 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 CanRau changed the title Unable to install (error Couldn't find package "[email protected]" required by "surrealdb.node" on the "npm" registry.) Unable to install (error Couldn't find package "[email protected]") Oct 5, 2023
@CanRau CanRau mentioned this issue Oct 26, 2023
@CanRau
Copy link
Author

CanRau commented Nov 14, 2023

Any chance someone could help me figure this out? 😇

@CanRau
Copy link
Author

CanRau commented Nov 16, 2023

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"] }
  1. yarn build in surrealdb.node dir
  2. add "surrealdb.node": "0.4.0" to main project's package.json
  3. yarn install in project root
  4. yarn dev 🚀

@CanRau
Copy link
Author

CanRau commented Nov 17, 2023

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
Copy link

Has development of this library been discontinued?

@MountainAndMorning
Copy link

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
Copy link
Author

CanRau commented Dec 15, 2023

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
Copy link
Author

CanRau commented Dec 18, 2023

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
Copy link

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
Copy link
Member

kearfy commented Jan 4, 2024

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
Copy link
Author

CanRau commented Jan 4, 2024

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
Copy link

nottisa commented Mar 21, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants