mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 17:00:50 +00:00
fix: warn before npm prefix redirection (#73890) (thanks @Sayeem3051)
This commit is contained in:
@@ -1633,9 +1633,12 @@ fix_npm_permissions() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
ui_warn "npm global prefix is not writable: ${npm_prefix}"
|
||||
ui_warn "The installer will switch npm's user prefix to ${HOME}/.npm-global; npm normally writes that setting to ~/.npmrc."
|
||||
ui_info "Configuring npm for user-local installs"
|
||||
mkdir -p "$HOME/.npm-global"
|
||||
npm config set prefix "$HOME/.npm-global"
|
||||
ui_warn "Avoid sudo npm i -g for future OpenClaw updates; use npm i -g openclaw@latest so npm keeps using this user prefix instead of a different global prefix."
|
||||
|
||||
# shellcheck disable=SC2016
|
||||
local path_line='export PATH="$HOME/.npm-global/bin:$PATH"'
|
||||
|
||||
Reference in New Issue
Block a user