Requested Feature
The pnpm feature configures PNPM_HOME and PATH only by appending exports to shell rc files (.bashrc, .zshrc, .profile). This works for interactive terminals but means pnpm is not on PATH inside non-interactive /bin/sh -c invocations — including devcontainer lifecycle scripts (onCreateCommand, postCreateCommand, etc.) and other features' lifecycle hooks.
Proposed fix: Have the feature declare containerEnv in its devcontainer-feature.json so the values are baked into the image and inherited by every shell — interactive or not:
"containerEnv": {
"PNPM_HOME": "/home/<user>/.local/share/pnpm",
"PATH": "/home/<user>/.local/share/pnpm/bin:${PATH}"
}
I'm hoping this will help me use this feature in combination with mount-pnpm-store:
"features": {
"ghcr.io/joshuanianji/devcontainer-features/mount-pnpm-store:1": {},
"ghcr.io/devcontainers-extra/features/pnpm:2": {},
}
Currently I cannot use these two together without adding this in my own devcontainer.json
"remoteEnv": {
"PNPM_HOME": "/home/vscode/.local/share/pnpm",
"PATH": "/home/vscode/.local/share/pnpm/bin:${containerEnv:PATH}"
}
Requested Feature
The
pnpmfeature configuresPNPM_HOMEand PATH only by appending exports to shell rc files (.bashrc,.zshrc,.profile). This works for interactive terminals but means pnpm is not on PATH inside non-interactive/bin/sh -cinvocations — including devcontainer lifecycle scripts (onCreateCommand,postCreateCommand, etc.) and other features' lifecycle hooks.Proposed fix: Have the feature declare
containerEnvin itsdevcontainer-feature.jsonso the values are baked into the image and inherited by every shell — interactive or not:I'm hoping this will help me use this feature in combination with mount-pnpm-store:
Currently I cannot use these two together without adding this in my own devcontainer.json