fix: node path find error
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user