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

Feature Request: install a custom local build of nodejs #2218

Open
kumavis opened this issue May 13, 2020 · 7 comments
Open

Feature Request: install a custom local build of nodejs #2218

kumavis opened this issue May 13, 2020 · 7 comments
Labels
feature requests I want a new feature in nvm! installing node Issues with installing node/io.js versions.

Comments

@kumavis
Copy link

kumavis commented May 13, 2020

First: I love nvm, its amazing, I use it all the time. 😸

I'm experimenting with building forks of nodejs.
I'd like to be able to add these builds to nvm's locally installed versions.

here's what I imagine the usage looks like

nvm install-local 'xyz-v1.0.0' ./out/Release
nvm which current
# ~/.nvm/versions/node/xyz-v1.0.0/bin/node

I'd expect it to copy the built release so that it doesn't change when I rebuild.
I don't have strong opinions about how the version number works.

Is this currently possible? if not, does this seem reasonable?

@kumavis
Copy link
Author

kumavis commented May 13, 2020

@ljharb 👋

@kumavis
Copy link
Author

kumavis commented May 13, 2020

this seems to work, would be nice to support a prefix like iojs (maybe local-<version>)

# from node dir
tools/install.py install /home/xyz/.nvm/versions/node/ v100.0.4
nvm use v100.0.4

@ljharb
Copy link
Member

ljharb commented May 14, 2020

So, any workarounds are something that are highly likely to break with future nvm/node versions; I'd suggest avoiding those.

All nvm use does is set up the $PATH - is there a reason you can't locally install one, and when you want to run it, provide the PATH to the binary's directory?

In general, the number of people on the planet who will be compiling their own version of node and also needing to test it separately from a system version of node is likely just barely beyond the single digits, so I'm hesitant to add complexity to nvm unless it's going to benefit a significant percentage of users.

@ljharb ljharb added feature requests I want a new feature in nvm! installing node Issues with installing node/io.js versions. labels May 14, 2020
@ljharb
Copy link
Member

ljharb commented May 14, 2020

(similar to #1053)

@jayderk13

This comment has been minimized.

@OpenGG
Copy link

OpenGG commented Aug 20, 2021

Dirty solution:

# Install custom node as 1.9.0 version. Or choose any version number as you like.
mkdir ~/.nvm/node/v1.9.0

# Make symbolic link to bin dir
ln -s /your/path/to/node/bin ~/.nvm/node/v1.9.0/bin

# Make alias to simply switching
nvm alias g v1.9.0

# Use custom local version
nvm use g

@dailytabs
Copy link

dailytabs commented Sep 1, 2024

I would kind of like to reference the node and npm installed by my gradle plugin.

Doing something like nvm install-local /path/to/project/.gradle/nodejs/node-v20.16.0-linux-x64 --npm /path/to/project/.gradle/npm/npm-v10.8.2 my-project-node -> nvm use my-project-node would be handy.

Would be even better if I didn't have to update it every time I updated the node/npm versions set in my gradle file (nvm link-gradle /path/to/project my-project-node), but there are multiple node plugins for gradle and that could be a nightmare to support them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature requests I want a new feature in nvm! installing node Issues with installing node/io.js versions.
Projects
None yet
Development

No branches or pull requests

5 participants