Skip to content

Commit b889cb6

Browse files
committed
Fixed global npm path installation
1 parent e5eeb81 commit b889cb6

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

railway-entrypoint.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ export XDG_CONFIG_HOME="$CLAUDER_HOME/.config"
2828
export XDG_CACHE_HOME="$CLAUDER_HOME/.cache"
2929
export XDG_STATE_HOME="$CLAUDER_HOME/.local/state"
3030

31-
# PATH: Include ~/.local/bin where Claude installs by default
32-
export PATH="$CLAUDER_HOME/.local/bin:$CLAUDER_HOME/.local/node/bin:$CLAUDER_HOME/.claude/local:$CLAUDER_HOME/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/lib/code-server/lib/vscode/bin/remote-cli:$PATH"
31+
# PATH: Include all possible locations for installed tools
32+
# - ~/.local/bin: pip user installs, pipx, local scripts
33+
# - ~/.npm-global/bin: npm global installs (non-root)
34+
# - /usr/local/bin: system-wide installs
35+
# - /usr/lib/node_modules/.bin: npm global installs (root/sudo)
36+
export PATH="$CLAUDER_HOME/.local/bin:$CLAUDER_HOME/.npm-global/bin:$CLAUDER_HOME/.local/node/bin:$CLAUDER_HOME/.claude/local:$CLAUDER_HOME/node_modules/.bin:/usr/local/bin:/usr/bin:/usr/lib/node_modules/.bin:/usr/lib/code-server/lib/vscode/bin/remote-cli:$PATH"
3337

3438
echo "→ Initial user: $(whoami) (UID: $(id -u))"
3539
echo "→ RUN_AS_USER: $RUN_AS_USER"
@@ -62,18 +66,25 @@ if [ "$(id -u)" = "0" ]; then
6266

6367
PROFILE_FILE="$HOME/.bashrc"
6468

65-
if [ ! -f "$PROFILE_FILE" ] || ! grep -q '.local/bin' "$PROFILE_FILE" 2>/dev/null; then
69+
if [ ! -f "$PROFILE_FILE" ] || ! grep -q '.npm-global' "$PROFILE_FILE" 2>/dev/null; then
6670
echo "→ Setting up shell profile..."
6771
cat >> "$PROFILE_FILE" << 'PROFILE'
6872
6973
# ============================================================================
7074
# VSCode Cloud IDE - PATH Configuration
7175
# ============================================================================
72-
export PATH="$HOME/.local/bin:$HOME/.local/node/bin:$HOME/.claude/local:$PATH"
76+
export PATH="$HOME/.local/bin:$HOME/.npm-global/bin:$HOME/.local/node/bin:$HOME/.claude/local:$PATH"
77+
78+
# npm global prefix for non-root installs
79+
export NPM_CONFIG_PREFIX="$HOME/.npm-global"
7380
7481
# Claude Code alias with --dangerously-skip-permissions
7582
alias claude-auto='claude --dangerously-skip-permissions'
7683
PROFILE
84+
85+
# Create npm global directory
86+
mkdir -p "$HOME/.npm-global/bin" 2>/dev/null || true
87+
7788
echo " ✓ Shell profile configured"
7889
fi
7990

0 commit comments

Comments
 (0)