You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] just init fails to install devcontainer CLI — npm global install permission denied #111
just init fails to install the devcontainer CLI on Linux because npm install -g requires write access to /usr/local/lib/node_modules, which is owned by root.
Steps to Reproduce
Run just init on a Linux machine where devcontainer CLI is not installed
When prompted to install devcontainer, accept with y
Expected Behavior
The devcontainer CLI should install successfully without requiring sudo or manual intervention.
Actual Behavior
The installation fails with EACCES: permission denied:
npm: system npm with default global prefix (/usr/local/lib/node_modules)
Node: system Node.js
Additional Context
@devcontainers/[email protected] is already declared as a local dependency in package.json. The bats dependency already uses the correct pattern — local npm install with a node_modules/.bin/ check fallback. The devcontainer entry should follow the same approach instead of requiring a global install.
Possible Solution
Change the devcontainer entry in scripts/requirements.yaml to:
Use npm install (local) instead of npm install -g (global)
Check node_modules/.bin/devcontainer in addition to command -v devcontainer
Use npx devcontainer --version for version checking
This matches the existing bats pattern and avoids permission issues entirely.
The devcontainer entry in scripts/requirements.yaml uses npm install -g @devcontainers/cli@{{version}} which requires root permissions on Linux. Meanwhile, @devcontainers/[email protected] is already declared in package.json as a local dependency.
Fix
Follow the same pattern already used by bats in requirements.yaml:
Activity
c-vigo commentedon Feb 20, 2026
Implementation Plan
Root Cause
The
devcontainerentry inscripts/requirements.yamlusesnpm install -g @devcontainers/cli@{{version}}which requires root permissions on Linux. Meanwhile,@devcontainers/[email protected]is already declared inpackage.jsonas a local dependency.Fix
Follow the same pattern already used by
batsinrequirements.yaml:Before:
After:
Files Changed
scripts/requirements.yaml— update devcontainer entry (check command, version command, install command, comment)What Does NOT Change
package.json— already has the dependency at the correct version.github/actions/setup-env/action.yml— CI runs with proper permissions, no change neededtests/bats/init.bats— existing tests are structural grep checks, unaffectedTDD Steps
requirements.yamlusesnode_modules/.bin/devcontainercheck pattern → failsrequirements.yaml→ test passesjust init --checkconfirms devcontainer is detected via local pathtest(setup): add tests for devcontainer local npm install pattern
fix(setup): use local npm install for devcontainer CLI
docs(setup): add changelog entry for devcontainer npm permissions fix
test(setup): add tests for conftest.py devcontainer local path check
fix(setup): detect devcontainer CLI in node_modules/.bin from pytest
fix: resolve devcontainer CLI from node_modules/.bin
fix(setup): use local npm install for devcontainer CLI (#112)