How can I update NodeJS and NPM to the next versions?

后端 未结 30 2147
北荒
北荒 2020-11-22 08:07

I just installed Node.js and npm (for additional modules).

How can I update Node.js and the modules which I\'m using to the latest versions

30条回答
  •  无人共我
    2020-11-22 08:57

    Upgrading for Windows Users

    Windows users should read Troubleshooting > Upgrading on Windows in the npm wiki.

    Upgrading on windows 10 using PowerShell (3rd party edit)

    The link above Troubleshooting#upgrading-on-windows points to a github page npm-windows-upgrade the lines below are quotes from the readme. I successfully upgraded from npm 2.7.4 to npm 3.9.3 using node v5.7.0 and powershell (presumably powershell version 5.0.10586.122)

    First, ensure that you can execute scripts on your system by running the following command from an elevated PowerShell. To run PowerShell as Administrator, click Start, search for PowerShell, right-click PowerShell and select Run as Administrator.

    Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force    
    

    Then, to install and use this upgrader tool, run (also from an elevated PowerShell or cmd.exe):

    npm install --global --production npm-windows-upgrade
    npm-windows-upgrade
    

提交回复
热议问题