fix: node path find error

This commit is contained in:
engigu
2026-03-23 22:54:54 +08:00
parent cfefcedc16
commit 2852e794a2
2 changed files with 6 additions and 4 deletions
+3 -3
View File
@@ -23,9 +23,9 @@ jobs:
# - base_type: alpine
# base_tag: base-alpine
# tag_suffix: "-alpine"
- base_type: debian13
base_tag: base-debian13
tag_suffix: "-debian13"
# - base_type: debian13
# base_tag: base-debian13
# tag_suffix: "-debian13"
permissions:
contents: read
+3 -1
View File
@@ -23,7 +23,9 @@ func GetMiseNodePath(version string) string {
if err == nil {
nodeDir := strings.TrimSpace(string(out))
if nodeDir != "" {
nodePath := nodeDir + "/lib/node_modules"
// 采用双路径策略:lib/node_modules 是标准路径,lib 是某些环境(如 mise Docker)下的特殊路径
// 通过冒号分隔,让 Node.js 按顺序搜索,保证最大兼容性
nodePath := nodeDir + "/lib/node_modules:" + nodeDir + "/lib"
nodePathCache.Store(version, nodePath)
return nodePath
}