如何更新 Node.js? [英] How do I update Node.js?

查看:44
本文介绍了如何更新 Node.js?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了以下更新我的 npm:

npm 更新 npm -g

但我不知道如何更新 Node.js.有什么建议?(我使用的是 Node.js 0.4.1,想更新到 Node.js 0.6.1.)

解决方案

使用

  • 使用命令 nvm install version 例如nvm install 12.14.0 安装到机器上
  • 最后一次安装使用 nvm use version 使用较新的版本,例如nvm 使用 12.14.0
  • I did the following to update my npm:

    npm update npm -g
    

    But I have no idea how to update Node.js. Any suggestions? (I'm using Node.js 0.4.1 and want to update to Node.js 0.6.1.)

    解决方案

    Use Node Version Manager (NVM)

    It's a Bash script that lets you download and manage different versions of node. Full source code is here.

    There is a separate project for nvm for Windows: github.com/coreybutler/nvm-windows

    Below are the full steps to use NVM for multiple version of node on windows

    1. download nvm-setup.zip extract and install it.
    2. execute command nvm list available from cmd or gitbash or powershell, this will list all available version of node
    3. use command nvm install version e.g. nvm install 12.14.0 to install on the machine
    4. last once installed use nvm use version to use newer version e.g. nvm use 12.14.0

    这篇关于如何更新 Node.js?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆