mirror of
https://github.com/photoprism/photoprism.git
synced 2026-07-17 16:49:04 +00:00
Scripts: Use absolute "/root/.cache/npm" path in install-nodejs.sh
When invoked as "sudo bash install-nodejs.sh" by an unprivileged user, "~" expanded to the calling user's home before sudo elevated, so root's ".npmrc" ended up with "cache=/home/<user>/.cache/npm" and subsequent "sudo npm install -g" runs left root-owned cache dirs inside the user's home. Hardcode the path so the cache always lands under root.
This commit is contained in:
parent
bb53e9e972
commit
7f4b9ad668
1 changed files with 1 additions and 1 deletions
2
scripts/dist/install-nodejs.sh
vendored
2
scripts/dist/install-nodejs.sh
vendored
|
|
@ -48,7 +48,7 @@ fi
|
|||
|
||||
# Upgrade NPM and install development dependencies.
|
||||
echo "Configuring NPM..."
|
||||
sudo npm config set cache ~/.cache/npm
|
||||
sudo npm config set cache /root/.cache/npm
|
||||
echo "Updating NPM..."
|
||||
sudo npm install -g --ignore-scripts --no-fund --no-audit --no-update-notifier "npm@$NPM_VERSION" n@latest
|
||||
echo "Installing npm-check-updates and license-report..."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue