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_type: alpine
# base_tag: base-alpine # base_tag: base-alpine
# tag_suffix: "-alpine" # tag_suffix: "-alpine"
- base_type: debian13 # - base_type: debian13
base_tag: base-debian13 # base_tag: base-debian13
tag_suffix: "-debian13" # tag_suffix: "-debian13"
permissions: permissions:
contents: read contents: read
+3 -1
View File
@@ -23,7 +23,9 @@ func GetMiseNodePath(version string) string {
if err == nil { if err == nil {
nodeDir := strings.TrimSpace(string(out)) nodeDir := strings.TrimSpace(string(out))
if nodeDir != "" { 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) nodePathCache.Store(version, nodePath)
return nodePath return nodePath
} }