How to downgrade Node version

前端 未结 12 751
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 10:53

I want to downgrade my Node version from the latest to v6.10.3.

But nothing worked so far. Tried NVM and it gives an error as well by saying make comman

相关标签:
12条回答
  • 2020-12-12 11:35

    For windows:

    Steps

    1. Go to Control panel> program and features>Node.js then uninstall

    2. Go to website: https://nodejs.org/en/ and download the version and install.

    0 讨论(0)
  • 2020-12-12 11:36

    In case of windows, one of the options you have is to uninstall current version of Node. Then, go to the node website and download the desired version and install this last one instead.

    0 讨论(0)
  • 2020-12-12 11:39

    Try using the following commands

    //For make issues 
    sudo apt-get install build-essential
    
    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
    
    //To uninstall a node version 
    nvm uninstall <current version>
    
    nvm install 6.10.3
    
    nvm use 6.10.3
    
    //check with 
    node -v
    
    0 讨论(0)
  • 2020-12-12 11:43

    This may be due to version incompatibility between your code and the version you have installed.

    In my case I was using v8.12.0 for development (locally) and installed latest version v13.7.0 on the server.

    So using nvm I switched the node version to v8.12.0 with the below command:

    > nvm install 8.12.0 // to install the version I wanted
    
    > nvm use 8.12.0  // use the installed version
    

    NOTE: You need to install nvm on your system to use nvm.

    You should try this solution before trying solutions like installing build-essentials or uninstalling the current node version because you could switch between versions easily than reverting all the installations/uninstallations that you've done.

    0 讨论(0)
  • 2020-12-12 11:44

    Determining your Node version

    node -v  // or node --version
    npm -v   // npm version or long npm --version
    

    Ensure that you have n installed

    sudo npm install -g n // -g for global installation 
    

    Upgrading to the latest stable version

    sudo n stable
    

    Changing to a specific version

    sudo n 10.16.0
    

    Answer inspired by this article.

    0 讨论(0)
  • 2020-12-12 11:45

    If you're on Windows I suggest manually uninstalling node and installing chocolatey to handle your node installation. choco is a great CLI for provisioning a ton of popular software.

    Then you can just do,

    choco install nodejs --version $VersionNumber
    

    and if you already have it installed via chocolatey you can do,

    choco uninstall nodejs 
    choco install nodejs --version $VersionNumber
    

    For example,

    choco uninstall nodejs
    choco install nodejs --version 12.9.1
    
    0 讨论(0)
提交回复
热议问题