[🐞] EACCES: permission denied, mkdir '/dist'
### Which component is affected?
Build process
### Describe the bug
When running `astro build` in a Deno environment, the build process fails due to a permission error. The error message is as follows:
```ansi
21:53:14 [ERROR] [@qwikdev/astro] An unhandled error occurred while running the "astro:build:ssr" hook
EACCES: permission denied, mkdir '/dist'
Location:
/home/qz/dev/qwik_astro/node_modules/.deno/vite@6.3.5/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:6860:15
Stack trace:
at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:91:3)
at denoErrorToNodeError (ext:deno_node/internal/errors.ts:1914:14)
at copyDir (file:///home/qz/dev/qwik_astro/node_modules/.deno/vite@6.3.5/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:6860:15)
at buildEnvironment (file:///home/qz/dev/qwik_astro/node_modules/.deno/vite@6.3.5/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:46208:7)
at async withTakingALongTimeMsg (file:///home/qz/dev/qwik_astro/node_modules/.deno/astro@5.10.1/node_modules/astro/dist/integrations/hooks.js:32:12)
```
Expected behavior:
The build should complete without any permission errors.
### Reproduction
(none)
### Steps to reproduce
1. Run `deno -A npm:@qwikdev/create-astro`
```ansi
qz@qz-linux:~/dev$ deno -A npm:@qwikdev/create-astro
│
◇ Where would you like to create your new project? (Use './' for current directory)
│ ./qwik_astro
│
◇ Would you like to use the default template?
│ Yes
│
◇ Would you like to use a server adapter?
│ No
│
◇ Would you prefer Biome over ESLint/Prettier?
│ Yes
│
◇ Would you like to add CI workflow?
│ Yes
│
◇ Would you like to install deno dependencies?
│ Yes
│
◇ Would you like to initialize Git?
│ Yes
│
◇ What should be the name of this package?
│ qwik_astro
┌ Let's create a QwikDevAstro App ✨
│
◇ Creating new project in /home/qz/dev/qwik_astro ... 🐇
│
◇ Copying `.gitignore` file... 🙈
│
◇ Installing dependencies...
Warning The following packages contained npm lifecycle scripts (preinstall/install/postinstall) that were not executed:
┠─ npm:@biomejs/biome@1.9.4
┠─ npm:sharp@0.33.5
┃
┠─ This may cause the packages to not work correctly.
┖─ To run lifecycle scripts, use the `--allow-scripts` flag with `deno install`:
deno install --allow-scripts=npm:@biomejs/biome@1.9.4,npm:sharp@0.33.5
│
● ℹ️ Updated package name to "qwik_astro" 📦️
│
● ℹ️ Replacing 'npm run' by 'deno' in package.json...
│
◇ 👷 Adding CI workflow...
│
◇ Git initialized 🎲
│
◇ Ready to start 🚀 ──────────────────────────────────────────────────────────────────────────────────╮
│ │
│ 🦄 Success! Project created in dev/qwik_astro directory │
│ │
│ 🐰 Next steps: │
│ cd dev/qwik_astro │
│ deno start │
│ │
├──────────────────────────────────────────────────────────────────────────────────────────────────────╯
│
└ Happy coding! 💻🎉
```
2. Run `cd ./qwik_astro`
3. Run `deno -A npm:astro build`
```ansii
qz@qz-linux:~/dev/qwik_astro$ deno -A npm:astro build
21:53:11 [content] Syncing content
21:53:11 [content] Synced content
21:53:11 [types] Generated 307ms
21:53:11 [build] output: "static"
21:53:11 [build] mode: "static"
21:53:11 [build] directory: /home/qz/dev/qwik_astro/dist/
21:53:11 [build] Collecting build info...
21:53:11 [build] ✓ Completed in 329ms.
21:53:11 [build] Building static entrypoints...
21:53:14 [vite] ✓ built in 2.75s
21:53:14 [build] ✓ Completed in 2.80s.
vite v6.3.5 building for production...
✓ 10 modules transformed.
✗ Build failed in 366ms
21:53:14 [ERROR] [@qwikdev/astro] An unhandled error occurred while running the "astro:build:ssr" hook
EACCES: permission denied, mkdir '/dist'
Location:
/home/qz/dev/qwik_astro/node_modules/.deno/vite@6.3.5/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:6860:15
Stack trace:
at __node_internal_captureLargerStackTrace (ext:deno_node/internal/errors.ts:91:3)
at denoErrorToNodeError (ext:deno_node/internal/errors.ts:1914:14)
at copyDir (file:///home/qz/dev/qwik_astro/node_modules/.deno/vite@6.3.5/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:6860:15)
at buildEnvironment (file:///home/qz/dev/qwik_astro/node_modules/.deno/vite@6.3.5/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:46208:7)
at async withTakingALongTimeMsg (file:///home/qz/dev/qwik_astro/node_modules/.deno/astro@5.10.1/node_modules/astro/dist/integrations/hooks.js:32:12)
```
### System Info
```shell
Deno: 2.3.7+b5e41f6 (canary)
System:
OS: Linux 6.14 Ubuntu 25.04 25.04 (Plucky Puffin)
Container: Yes
Shell: 5.2.37 - /bin/bash
Binaries:
Node: 24.3.0 - ~/.local/share/pnpm/node
npm: 11.4.2 - ~/.local/share/pnpm/npm
pnpm: 10.12.4 - ~/.local/share/pnpm/pnpm
```
### Additional Information
_No response_
2 条评论