docs: document pnpm EACCES issue on WSL2 Windows filesystem
pnpm fails with permission denied during atomic rename on /mnt/d/ (NTFS). Solution: keep app/ on WSL2 native fs (~/fire_goal/app/). - 04-风险与避坑.md: add as 三级坑 with cause, fix, and principle - 03-架构设计.md: add WSL2 native path requirement with HBuilderX access path Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -114,6 +114,27 @@ interface Store {
|
||||
|
||||
WSL2 会自动将内部端口转发到 Windows 的 `localhost`,所以 WSL2 里启动的 dev server,Windows 浏览器直接用 `http://localhost:端口` 访问,热更新也正常生效。
|
||||
|
||||
### ⚠️ app/ 必须放在 WSL2 原生文件系统
|
||||
|
||||
pnpm 在 `/mnt/d/`(Windows NTFS 挂载)上做原子重命名时会报 `EACCES` 权限错误,导致 `pnpm install` 失败。
|
||||
|
||||
**正确路径**:`~/fire_goal/app/`(WSL2 原生 ext4)
|
||||
|
||||
```bash
|
||||
# 开发时进入 WSL2 原生目录
|
||||
cd ~/fire_goal/app
|
||||
pnpm install # ✅ 无权限问题
|
||||
pnpm dev:h5
|
||||
```
|
||||
|
||||
Windows 侧(HBuilderX 云打包)通过以下路径访问:
|
||||
|
||||
```
|
||||
\\wsl$\Ubuntu\home\<用户名>\fire_goal\app
|
||||
```
|
||||
|
||||
> docs/ 和 research/ 仍在 `/mnt/d/opc_project/fire_goal/`,用 git 管理;app/ 在 WSL2 原生 fs 单独开发。
|
||||
|
||||
### 必须的 Vite 配置
|
||||
|
||||
Vite 默认只监听 `127.0.0.1`(WSL2 内部),需改为监听所有网卡,否则 Windows 浏览器无法访问。
|
||||
|
||||
Reference in New Issue
Block a user