Skip to content

Commit bceb72a

Browse files
committed
fix: improve TypeScript installation reliability by handling mise conflicts and multiple tsc locations
1 parent 72d2267 commit bceb72a

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

setup-node-env/action.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,39 @@ runs:
122122
shell: bash
123123
run: |
124124
echo "Installing TypeScript globally with npm..."
125-
npm install -g typescript
125+
# Disable mise auto-install/reshim to avoid conflicts
126+
export MISE_AUTO_INSTALL=0
127+
export MISE_EXPERIMENTAL=0
128+
129+
# Install TypeScript globally
130+
npm install -g typescript || true
131+
132+
# Manually ensure mise shims are updated
133+
mise reshim || true
126134
127135
# Add npm global bin to PATH for subsequent steps
128136
NPM_GLOBAL_BIN="$(npm bin -g)"
129137
echo "$NPM_GLOBAL_BIN" >> $GITHUB_PATH
130138
131-
# Verify TypeScript is accessible
139+
# Also add mise shims directory to PATH
140+
MISE_SHIMS="$HOME/.local/share/mise/shims"
141+
echo "$MISE_SHIMS" >> $GITHUB_PATH
142+
143+
# Verify TypeScript is accessible (try multiple locations)
132144
echo "Verifying TypeScript installation..."
133-
which tsc || { echo "Error: tsc binary not found in PATH"; exit 1; }
134-
tsc --version || { echo "Error: TypeScript not found in PATH"; exit 1; }
145+
if command -v tsc &> /dev/null; then
146+
echo "Found tsc at: $(which tsc)"
147+
tsc --version
148+
elif [ -f "$NPM_GLOBAL_BIN/tsc" ]; then
149+
echo "Found tsc at: $NPM_GLOBAL_BIN/tsc"
150+
"$NPM_GLOBAL_BIN/tsc" --version
151+
elif [ -f "$MISE_SHIMS/tsc" ]; then
152+
echo "Found tsc at: $MISE_SHIMS/tsc"
153+
"$MISE_SHIMS/tsc" --version
154+
else
155+
echo "Error: TypeScript not found in PATH"
156+
exit 1
157+
fi
135158
136159
- name: Install dependencies
137160
if: inputs.install_deps == 'true'

0 commit comments

Comments
 (0)