Skip to content

Vagrant: run pnpm install as vagrant user, not root#1362

Merged
gusthoff merged 1 commit into
AdaCore:mainfrom
gusthoff:topic/infrastructure/vagrant/20260529/pnpm_fix
May 30, 2026
Merged

Vagrant: run pnpm install as vagrant user, not root#1362
gusthoff merged 1 commit into
AdaCore:mainfrom
gusthoff:topic/infrastructure/vagrant/20260529/pnpm_fix

Conversation

@gusthoff
Copy link
Copy Markdown
Collaborator

Previously, both provisioning scripts ran pnpm install --frozen-lockfile as root (the default for Vagrant shell provisioners). This linked node_modules from root's pnpm store (/root/.local/share/pnpm/store/v11), causing an ERR_PNPM_UNEXPECTED_STORE mismatch whenever the vagrant user ran pnpm commands (which use /home/vagrant/.local/share/pnpm/store/v11).

Fixed by running pnpm install via sudo -u vagrant bash -c "..." so node_modules is linked from the vagrant user's store from the start. COREPACK_ENABLE_DOWNLOAD_PROMPT=0 is passed explicitly since .bashrc is not sourced in the non-interactive subshell.

Previously, both provisioning scripts ran `pnpm install --frozen-lockfile`
as root (the default for Vagrant shell provisioners). This linked
node_modules from root's pnpm store (/root/.local/share/pnpm/store/v11),
causing an ERR_PNPM_UNEXPECTED_STORE mismatch whenever the vagrant user
ran pnpm commands (which use /home/vagrant/.local/share/pnpm/store/v11).

Fixed by running pnpm install via `sudo -u vagrant bash -c "..."` so
node_modules is linked from the vagrant user's store from the start.
COREPACK_ENABLE_DOWNLOAD_PROMPT=0 is passed explicitly since .bashrc is
not sourced in the non-interactive subshell.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gusthoff gusthoff merged commit 9115b24 into AdaCore:main May 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant