Skip to content

Commit d148acd

Browse files
docs(faq): harmonize desktop node environment FAQ across locales
Synchronize content structure and technical details between English and Chinese versions. Align technical accuracy while maintaining locale-specific presentation. Co-Authored-By: Hagicode <noreply@hagicode.com> Signed-off-by: newbe36524 <newbe36524@qq.com>
1 parent f673e2d commit d148acd

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/content/docs/en/faq/desktop-node-environment.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,15 @@ HAGICODE_PORTABLE_TOOLCHAIN_ROOT=/path/to/portable-fixed/toolchain
3636
```
3737

3838
This variable means the Desktop-managed runtime environment recognized the bundled toolchain root. Seeing this path does not mean Desktop changed your system Node; it only means Desktop is using the Node environment shipped with the app inside its own runtime scope.
39+
40+
## Where Desktop installs managed npm packages
41+
42+
Desktop keeps runtime files and mutable npm package files in different locations. The bundled toolchain path such as `portable-fixed/toolchain/node` is the immutable source for the Desktop-managed `node` and `npm` commands. Managed global packages are installed under the Electron user data directory instead:
43+
44+
```text
45+
userData/node22/npmGlobal
46+
```
47+
48+
If Desktop later moves to Node 24, it uses a separate package tree such as `userData/node24/npmGlobal`. Packages installed for Node 22 remain on disk but are not treated as installed for Node 24 until they are reinstalled into the new Node-major prefix.
49+
50+
Desktop dependency status only checks the active `userData/node<major>/npmGlobal` prefix. Package files outside that prefix are ignored by dependency management.

src/content/docs/faq/desktop-node-environment.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,15 @@ HAGICODE_PORTABLE_TOOLCHAIN_ROOT=/path/to/portable-fixed/toolchain
3636
```
3737

3838
这个变量表示当前 Desktop 管理的运行环境已经识别到内置工具链根目录。看到这类路径并不表示 Desktop 修改了你的系统 Node;它只说明 Desktop 在自己的运行范围内使用了随应用提供的 Node 环境。
39+
40+
## Desktop 把托管 npm 包安装到哪里
41+
42+
Desktop 会把运行时文件和可变的 npm 包文件放在不同位置。类似 `portable-fixed/toolchain/node` 的内置工具链路径只作为 Desktop 托管的 `node``npm` 命令来源,不再作为全局 npm 包安装目录。托管的全局包会安装到 Electron 的用户数据目录:
43+
44+
```text
45+
userData/node22/npmGlobal
46+
```
47+
48+
如果 Desktop 后续切换到 Node 24,会使用独立的 `userData/node24/npmGlobal` 包目录。Node 22 下已经安装的包会保留在磁盘上,但不会被 Node 24 视为已安装,需要重新安装到新的主版本目录中。
49+
50+
Desktop 的依赖项状态只检查当前生效的 `userData/node<major>/npmGlobal` 前缀。这个前缀之外的包文件不会参与依赖项管理判断。

0 commit comments

Comments
 (0)