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

[NFR] Add Node JS using NVM #162

Open
joglomedia opened this issue Nov 24, 2023 · 0 comments
Open

[NFR] Add Node JS using NVM #162

joglomedia opened this issue Nov 24, 2023 · 0 comments
Assignees

Comments

@joglomedia
Copy link
Owner

joglomedia commented Nov 24, 2023

Installed nvm in /opt/nvm as root. Seemed like an appropriate location.

# git clone https://github.com/nvm-sh/nvm.git /opt/nvm

Created the directory /usr/local/nvm. This is where the downloads will go ($NVM_DIR)

# mkdir /usr/local/nvm

Create the directory /usr/local/node. This is where the NPM global stuff will go:

# mkdir /usr/local/node

Created a file called nvm.sh in /etc/profile.d with the following contents:

# NVM load
export NVM_DIR=/usr/local/nvm # NVM & Node data
export NVM_INSTALL_DIR=/opt/nvm
[ -s "$NVM_INSTALL_DIR/nvm.sh" ] && \. "$NVM_INSTALL_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_INSTALL_DIR/bash_completion" ] && \. "$NVM_INSTALL_DIR/bash_completion"  # This loads nvm bash_completion

Append those content also to .bashrc

Re-login to a shell session, then set the default node version.

# nvm install 0.10
# nvm alias default 0.10

The node binaries should now be in the PATH for all users the next time you login to a shell session. NPM will install global things to the /usr/local/node prefix.

Reference: https://stackoverflow.com/a/19040346

@joglomedia joglomedia self-assigned this Nov 24, 2023
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