Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement local node.js support via nvm #3

Open
pjeby opened this issue Nov 11, 2017 · 1 comment
Open

Implement local node.js support via nvm #3

pjeby opened this issue Nov 11, 2017 · 1 comment
Assignees

Comments

@pjeby
Copy link
Member

pjeby commented Nov 11, 2017

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.

@pjeby pjeby self-assigned this Nov 11, 2017
@pjeby
Copy link
Member Author

pjeby commented Feb 7, 2022

This was basically implemented via .nvmrc support last year, but needs to be documented.

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

No branches or pull requests

1 participant