Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A detailed guide to setup a full Web development environment with Node.js, and Git for your operating system

NotificationsYou must be signed in to change notification settings

Web-Dev-Codi/Setup-a-local-Web-Development-Environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Install Node.js on Linux, Windows, and MacOS using (nvm)

nvm is a version manager fornode.js, designed to be installed per-user, and invoked per-shell.nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, andwindows WSL.

Installing NVM

Toinstall orupdate nvm, you should use the following cURL(for Linux, and MacOS) or Wget ( for Windows Powershell users) command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh| bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh| bash

Running either of the above commands downloads a script and runs it. The script clones the nvm repository to~/.nvm, and attempts to add the source lines from the snippet below to the correct profile file (~/.bash_profile,~/.zshrc,~/.profile, or~/.bashrc).

export NVM_DIR="$([-z"${XDG_CONFIG_HOME-}" ]&&printf %s"${HOME}/.nvm"||printf %s"${XDG_CONFIG_HOME}/nvm")"[-s"$NVM_DIR/nvm.sh" ]&&\."$NVM_DIR/nvm.sh"# This loads nvm

Verify Installation

Reload your terminal, than check if nvm is installed properly

To verify that nvm has been installed, do:

command -v nvm

or

nvm -v# to see the version number example: 0.39.3

If you want to see what versions are available to install:

nvm ls-remote

To install a specific version of node:

nvm install 14.7.0# or 16.3.0, 12.22.1, etc

To install the Long-term Support (A.K.A Stable version) of node:

nvm install --lts

Setting up Node.js on Windows

In Powershell
# installs fnm (Fast Node Manager)winget install Schniz.fnm# download and install Node.jsfnm use --install-if-missing 20# verifies the right Node.js version is in the environmentnode -v# should print `v20.14.0`# verifies the right NPM version is in the environmentnpm -v# should print `10.7.0`

or download the windows installer via (Node Windows installer) and follow install instructions

To verify that Node.js has been installed properly, in your shell type the following command:

node --version

Setting up git on Linux

In your terminal type in the command that matches your linux distributionFor administrator privileges be sure to usesudo

Debian/Ubuntu

For the latest stable version for your release of Debian/Ubuntu

apt-get install git

For Ubuntu, this PPA provides the latest stable upstream Git version

add-apt-repository ppa:git-core/ppa apt updateapt install git

Fedora

(up to Fedora 21)
yum install git
(Fedora 22 and later)
dnf install git

Gentoo

emerge --ask --verbose dev-vcs/git

Arch Linux

pacman -S git

openSUSE

zypper install git

Mageia

urpmi git

Nix/NixOS

nix-env -i git

FreeBSD

pkg install git

Solaris 9/10/11 (OpenCSW)

pkgutil -i git

Solaris 11 Express

pkg install developer/versioning/git

OpenBSD

pkg_add git

Alpine

apk add git

Setting up git on Windows 10/11

Install the standalone .exe

32-bit Git for Windows Setup.

64-bit Git for Windows Setup.

Check your git installation in the terminal

git --version

Setting up git credentials via the terminal

In your terminal type these commandswithout quotes

Enter your Github user name

git config --global user.name"Your Github User Name Here"

Enter the email you used to sign-up for GitHub (Very Important)

git config --global user.email"your@email.com"

Change the name of the master branch to main (Very Important)

git config --global init.defaultBranch main

Enter in terminal to see the config

git config --list

The terminal should look something like this

git config --listuser.name=Your Github User Name Hereuser.email=your@email.cominit.defaultbranch=main

Generating an SSH key

Remain in the terminal and enter these commands

ssh-keygen -t ed25519 -C yourgithub@email.com

Hit Enter until the process is done

In the terminal open the file id_ed25519.pub inside the .ssh directory within your Home directory with the following command.

cat id_ed25519.pub

copy paste the code to your github account by adding the ssh keyhere

Click New ssh key buttonalt textFill out the required fields and click the add ssh key buttonalt text

Once the ssh key is added, create a repository onGitHub, clone it, add files, commit and push. When you try to push the repository a popup with ask to add your system to github fully typeyes, and hitENTER.

Have fun and enjoy your new development environment.

Special thanks to nvm, Node.js, and git for helping me with the detailed information.


[8]ページ先頭

©2009-2025 Movatter.jp