admin管理员组

文章数量:1430129

Using the bun create [..] mand, I could create a react and a next project. It was straightforward following the instructions on the bun git repository (update: most instructions can be found at bun.sh).

But I could not get it to work with quasar/vue.

I could successfully install quasar with bun:

bun install -g @quasar/cli

But when I tried to create a quasar project:

quasar create [..]

I get a message like:

  • /usr/bin/env: ‘node’: Permission denied
  • /usr/bin/env: ‘node’: No such file or directory

It looks like quasar is trying to use the node executable instead of bun.

Any ideas how can I make it works with quasar/vue?

Using the bun create [..] mand, I could create a react and a next project. It was straightforward following the instructions on the bun git repository (update: most instructions can be found at bun.sh).

But I could not get it to work with quasar/vue.

I could successfully install quasar with bun:

bun install -g @quasar/cli

But when I tried to create a quasar project:

quasar create [..]

I get a message like:

  • /usr/bin/env: ‘node’: Permission denied
  • /usr/bin/env: ‘node’: No such file or directory

It looks like quasar is trying to use the node executable instead of bun.

Any ideas how can I make it works with quasar/vue?

Share Improve this question edited Sep 25, 2023 at 5:14 mxt 3053 silver badges17 bronze badges asked Jul 23, 2022 at 4:24 Thiago AraujoThiago Araujo 1893 silver badges15 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 1

The problem is that Bun.js is still missing a few packages like readline. See also here https://github./oven-sh/bun/issues/311.

bun --bun run quasar

Runs quite well and gives an output.

bun --bun run quasar build

Gives you the following error message.

error: Cannot find package "readline" from "/home/<user>/<project>/node_modules/@quasar/app-vite/lib/helpers/logger.js"
error: "quasar" exited with code 1 (SIGHUP)

I think we still have to wait for a stable v1.0.

Update 18.01.2023

With Bun v0.5.0 we are getting a little closer to the goal. Unfortunately the worker_threads support is still missing and therefore quasar build still fails.

quasar build output

There is an opened discussion on the Quasar repo, also Razvan Stoenescu, the creator of Quasar, opened a bug for this topic so we can expect tested support in some months

Update

As replied by Razvan Stoenescu

Will be available in q/app-vite v1.6 & q/app-webpack v3.11 (backported from the next major version of the CLIs -- unreleased yet)

Update 2

Since CLI v2.3.0 Quasar supports Bun as package manager: https://github./quasarframework/quasar/releases/tag/%40quasar%2Fcli-v2.3.0

Using bun 1.0.3 on a system without node installed, the following works to create a quasar project:

bun install -g @quasar/cli && bun create quasar

And you should be able to run quasar without node if you prefix it with bun run:

bun run quasar build

If you have a version of node installed and want to avoid using it, you MUST use the --bun flag to force the usage of bun instead of node:

bun create --bun quasar
bun run --bun quasar build

On machines without node installed --bun seems to be the default behavior.

Create an alias or function in your shell's .rc file:

function quasar() {
  # option A - "do not use node under any circumstances":
  # bun run --bun quasar "${@}"
  # option B - "node is fine to use when I have it"
  bun run quasar "${@}"
}

Then either restart your shell or source it:

# bash
source ~/.bashrc
# zsh
source ~/.zshrc
# etc...

now you can run quasar's cli with bun as you would normally:

quasar build

There may still be some mands that do not work correctly, see the patibility tracker.

from the quasar side, @quasar/cli-v2.30, @quasar/app-webpack-v3.11.0, and @quasar/app-vite-v1.6.0 are listed as officially supporting bun!

本文标签: javascriptHow to use Quasar Framework andor Vue3 with BunjsStack Overflow