Skip to content

fix: source nvm in playwright install script so npx is on PATH#86

Open
kohanyirobert wants to merge 1 commit intoschlich:mainfrom
kohanyirobert:fix/playwright-npx-path
Open

fix: source nvm in playwright install script so npx is on PATH#86
kohanyirobert wants to merge 1 commit intoschlich:mainfrom
kohanyirobert:fix/playwright-npx-path

Conversation

@kohanyirobert
Copy link

Problem

When the playwright feature runs its install.sh during container build, npx is not found even when the node feature is listed as a dependency.

Root cause: The node feature adds /usr/local/share/nvm/current/bin to PATH via containerEnv. However, containerEnv is applied to the running container, not to feature install scripts during image build. So npx is never on PATH when playwright's install script executes.

This affects users who add the playwright feature alongside an explicit node feature, or rely on the dependsOn: node declared in devcontainer-feature.json — the install order is correct, but the PATH is still missing.

Fix

Source nvm.sh at the top of install.sh before calling npx. The su invocation (for non-root installs) also re-sources nvm since it starts a fresh shell environment.

🤖 Generated with Claude Code

@kohanyirobert
Copy link
Author

One extra note is that I use mcr.microsoft.com/devcontainers/base:ubuntu24.04 as my base image, node is not installed by default in Dockerfile. If node is already baked in the existing feature works, but I think that's not how it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant