bun-promptx icon indicating copy to clipboard operation
bun-promptx copied to clipboard

Failed to open library. This is usually caused by a missing library or an invalid library path.

Open deadcoder0904 opened this issue 10 months ago • 3 comments

I got an error:

 9 |   filename = `../release/promptx-${platform}-amd64.${suffix}`;
10 | } else {
11 |   filename = `../release/promptx-${platform}-${arch}.${suffix}`;
12 | }
13 | var location = new URL(filename, import.meta.url).pathname;
14 | var { symbols } = dlopen(location, {
                       ^
ERR_DLOPEN_FAILED: Failed to open library. This is usually caused by a missing library or an invalid library path.
 syscall: "dlopen"

      at bun:ffi:61:41
      at D:\Code\Whatever\example.com\node_modules\bun-promptx\dist\index.mjs:14:19

On Windows 11 with Powershell 7.

My script was simple:

import { mkdir } from "node:fs/promises";
import { createPrompt } from 'bun-promptx'

const title = createPrompt("Enter title: ")
const tags = createPrompt("Enter tags: ")

const metadata = `---
title: '${title}'
date: '${new Date()}'
tags: [${tags}]
draft: true
---
`

const dir = "path/to/dir"
await mkdir(dir, { recursive: true });
await Bun.write(`${dir}/index.md`, metadata);

deadcoder0904 avatar Apr 06 '24 11:04 deadcoder0904

I have the same Issue on Bun 1.1.3 @wobsoriano

just-maik avatar Apr 12 '24 09:04 just-maik

@just-maik I went with just prompt in bun. it works but without styling & all.

deadcoder0904 avatar Apr 12 '24 17:04 deadcoder0904

Issue still persists on compile, Bun v1.1.22, Ubuntu 24.04 x64

Using the first example at README.md

bun build --compile --target=bun-linux-x64 ./index.ts --outfile devbuild-linux

okunamayanad avatar Aug 10 '24 22:08 okunamayanad