Skip to content

Implement local node.js support via nvm #3

@pjeby

Description

@pjeby

This would be done by .envrc checking for .deps/.nvm and sourcing the relevant bits with NVM_DIR set appropriately; there should probably be a --no-use option set by default. PATH should include node_modules/bin. The nvm module itself would just make sure that .deps/.nvm exists, and gets sourced.

Alternately, it might be simpler to use nvm only in a subshell for installation purposes; that is, to just link a specific nvm-supplied version to .deps/bin. That would avoid path manipulation issues, probably. The nvm module could supply an nvm function that calls the real nvm function in a subshell and symlinks the tools from the bin dir where node is. (e.g. via nvm which).

This does present the issue of whether to use a yarn or npm install if there's a package.json present; that should probably be done via a module specifically for that purpose, distinct from the nvm module. One might wish to use nvm and node without those behaviors or indeed a package.json at all.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions