How to Install NodeJS using HomeBrew (Package Manager) and N (Version Manager) on macOS

Поделиться
HTML-код
  • Опубликовано: 1 авг 2024
  • Please hit 👍Like Button and Subscribe to the channel to Support me 🙏
    Join this channel to get access to various perks:
    / @tanztalkstech
    00:00:00 Intro
    00:00:50 Download and Install NodeJS using Package Installer
    00:02:40 Install HomeBrew Package Manager
    00:04:45 Install NodeJS using HomeBrew
    00:06:38 Upgrade NodeJS using HomeBrew
    00:07:17 Uninstall NodeJS using HomeBrew
    00:08:11 Install n (Node Version Manager)
    00:09:25 Install NodeJS using n
    00:09:55 mkdir: usr/local/n: Permission Denied
    Error: sudo required (or change ownership, or define N_PREFIX)
    sudo mkdir -p /usr/local/n && sudo chown -R $(whoami) /usr/local/n
    00:11:40 Switching between different NodeJS Versions using n
    00:14:59 Uninstall NodeJS using n
    00:15:34 Uninstall n
    1. Type the following command to install Node.js and NPM:
    brew install node
    Homebrew downloads and installs the dependencies for the latest version of Nodejs and NOT the LTS Version.
    To Install the LTS version or any other version type:
    brew install node@18
    If another version of Node is already installed, you should uninstall it first to avoid conflicts.
    Also note that LTS versions of node (e.g. node@18) are keg-only and must either be linked with --force (brew link --force node@18) or you need to add the binary to your path by running:
    $nano ~/.zshrc
    export PATH="/usr/local/opt/node@18/bin:$PATH"
    2. When the installation finishes, confirm that you successfully installed Node.js by checking its version:
    node -v
    3. Next, check the installed version of NPM by typing:
    npm -v
    Step 3. Update Node.js and NPM on Mac
    brew upgrade node
    1. Uninstall both Node.js and NPM with the brew uninstall command:
    brew uninstall node
    2. Remove all the unused dependencies with:
    brew autoremove
    This command removes the packages that brew uninstall did not remove.
    npm install -g n
    The n command downloads and installs to /usr/local by default.
    On macOS with Homebrew you can install the n formula.
    brew install n
    Installing Node.js Versions
    Simply execute n version to download and install a version of Node.js. If it has already been downloaded, n will install from its cache.
    n 10.16.0
    n lts
    Execute n on its own to view your downloaded versions, and install the selected version.
    $ n
    node/4.9.1
    ο node/8.11.3
    node/10.15.0
    Use up/down arrow keys to select a version, return key to install, d to delete, q to quit
    If the active node version does not change after install, try opening a new shell in case seeing a stale version.
    Specifying Node.js Versions
    Numeric version numbers can be complete or incomplete, with an optional leading v.
    4.9.1
    8: 8.x.y versions
    v6.1: 6.1.x versions
    There are labels for two especially useful versions:
    • lts: newest Long Term Support official release
    • latest, current: newest official release
    There is support for the named release streams:
    argon, boron, carbon: codenames for LTS release streams
    Miscellaneous
    Command line help can be obtained from n --help.
    List matching remote versions available for download:
    n ls-remote lts
    n ls-remote latest
    n lsr 10
    n --all lsr
    List downloaded versions in cache:
    n ls
    Display diagnostics to help resolve problems:
    n doctor
    More Tutorials on macOS: • macOS Tutorials
    How to Install Linux Mint 21 "Vanessa" Cinnamon on VirtualBox: • Install Linux Mint 21 ...
    Install Ubuntu 22.10 (Kinetic Kudo) on VirtualBox: • How to Install Ubuntu ...
    Install Ubuntu 22.04 LTS in Oracle VirtualBox: / c5mj2swmn0
    Make Ubuntu Full Screen in Oracle VirtualBox: • How to Make Ubuntu Ful...
    Install Oracle Java (JDK) On Ubuntu 22.04 LTS, Debian Linux: • How To Install Oracle ...
    Install Node.js on Ubuntu 22.04 LTS | Install NodeJS and npm: • How To Install Node.js...
    Install and Use Visual Studio Code on Ubuntu 22.04 LTS Linux (VS Code): • How to Install and Use...
    Install macOS 12 Monterey on Oracle VirtualBox: • How to Install Apple m...
    Join our Facebook Group and Post your Problems: / 769372597093758
    VMware Workstation Tutorials:
    • VMware Workstation Tut...
    Install macOS 12 Monterey on VMware Player: • How to Install macOS 1...
    Install macOS 13 Ventura on VMware Player: • How to Install macOS 1...
    Install Ubuntu 22.04 LTS on VMware Player: • How to Install Ubuntu ...
    Follow Me on Facebook: tanzTalks.tech
    Instagram: / tanzeelosama
    My Gear:
    MSI GL65 Leopard Gaming Laptop
    Intel Core i7-10750H 2.6GHz, 10th Gen (6 Cores)
    15.6" FHD (1920*1080), IPS-Level 144Hz
    16GB DDR4 RAM, 2666Mhz
    Nvidia GeForce RTX 2060, 6GB ‎GDDR6
    256GB NVMe M.2 SSD + 1TB SATA 7200RPM HDD
    Windows 11 Home, 64Bit
    HD Webcam (720p at 30 fps)
    Per Key RGB SteelSeries Keypad
    #NodeJS #NPM #HomeBrew #macOS #tanztalkstech #tanzeelosama #tanzTalkstech2 ‪@tanzTalks.tech2‬ ‪@tanzTalkstech‬ ‪@TanzeelOAnsari‬
  • НаукаНаука

Комментарии • 12