zoukankan      html  css  js  c++  java
  • Uninstalling Node and Npm on MacOS

    Uninstalling Node and Npm

    To completely uninstall node and npm follow the below steps.

    1. Open your terminal.
    2. Now, run the below command by hitting the enter key.
    curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
    chmod +x ./uninstall-node.sh
    ./uninstall-node.sh
    rm uninstall-node.sh
    1. Go to the bin directory.
    cd /usr/local/bin
    1. At final run the following commands, to delete any node or node_modules inside the bin directory.
    sudo rm -rf /usr/local/bin/npm
    sudo rm -rf /usr/local/bin/node
    1. Verify if the node is completely uninstalled or not using node -v command.

    If the output shows command not found then you are successfully uninstalled.

    node verify uninstallation

    Installing node and npm using nvm

    We are using the node version manager (nvm) to download and install the latest version of node.js (with npm included).

    1. Run the following command in your terminal to install the nvm.
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
    1. If your using bash or zsh, you need to add the following code to ~/.bashrc or ~/.zshrc files.

    To open bashrc file in vscode use code ~/.bashrc command.

    To open zshrc file in vscode use code ~/.zshrc command.

    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm
    [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
    1. Verify the nvm installation by running the below command.
    nvm --version
    
    # 0.35.3

    If the output shows a version number then you are successfully installed.

    1. Now, run the following command to download and install the latest version of node.
    nvm install node

    If you want to install a long term support (LTS) version use this command.

    nvm install --lts

    or a specific version.

    nvm install 12.1.4
    1. To use the node, we need to set the default node version by using this command.
    nvm alias default node
    1. Verify the node and npm installation.
    node -v
    npm -v

    Output:

    v13.13.0
    6.14.4

    Y

  • 相关阅读:
    0505.Net基础班第十四天(winform基础)
    0505.Net基础班第十三天(面向对象多态)
    Z-index
    div的padding和margin
    隐藏div,文本框角圆滑,消除外边框
    页面加载完成之后运行方法里的内容,隐藏标签,判断字符串里面是否包含某个字符
    CSS命令
    漂浮
    电子时钟
    用二维数组存数据(学科成绩、总分以及平均值)
  • 原文地址:https://www.cnblogs.com/mouseleo/p/14590175.html
Copyright © 2011-2022 走看看