Skip to content

node + npm in pristine software repo with per-project isolation (Bash, launchers as functions) #2381

Description

@krystynaShatkovska

Feature idea

Related also to issue #352

Goal
Prove the concept with a minimal, Bash-only increment. Install node and npm as pristine, versioned installations in the shared software repository, and route each project's global npm packages into a per-project directory so projects no longer collide. Launchers are implemented as Bash functions (like the existing claude function in cli/src/main/package/functions), not as shim files.

Scope

  • node + npm installed into the software repository under softwareRepositoryPath/// (pristine layout), sharing one copy of a version across projects.
  • Bash function per tool (node, npm) in functions that, inside a project, resolves the project's configured version and runs that binary from the repo; outside a project, falls back to the system binary (mirrors claude()).
  • global npm packages installed to a per-project prefix (e.g. under the project dir), so npm i -g in one project does not write into the shared node install.
  • works in Bash / POSIX.

Acceptance criteria

  1. node and npm are installed into the pristine software repository, not ignored (isIgnoreSoftwareRepo no longer needed for the POC path).
  2. two projects (A and B) on the same node version but different npm versions both run correctly from Bash, each resolving its own npm.
  3. running npm i -g in project A lands the package in project A's directory and does not modify the shared node install or project B's packages (this is the Design for tools like node and python that hack their own installation #352 scenario).
  4. node/npm resolve via the Bash function in functions. Typing the command outside any project still works (falls back to the system binary).

Additional context

No response

Activity

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

Metadata

Metadata

Labels

enhancementNew feature or requestnodenode.js tool (JavaScript runtime)npmnode package managerready-to-implement

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions