node如何更新? - 网站

node如何更新?

分类:Node.js常见问题 · 发布时间:2019-09-09 15:53 · 阅读:3028

node的更新方法:先使用npm的命令npm install -g n安装n模块,然后使用n stable可以将node更新到最新版本,使用n+node版本号可以将node更新到指定版本。

更新node的方法:

一、使用npm 安装一个模块 n 到全局

 npm  install  -g  n

二、使用 n 安装最新版本:

n  stable

三、使用 n 加版本号就可以安装其他版本,比如:

n  6.11.3

四、再使用 n ,通过上下键,就可以选择不同的版本啦

注意:是从低版本升到高版本时多版本共存;如果是已经安装了高版本,再安装低版本时,高版本就没有了。

n模块的命令:

n help

  Usage: n [options/env] [COMMAND] [args]

  Environments:
    n [COMMAND] [args]            Uses default env (node)
    n project [COMMAND]           Uses custom env-variables to use non-official sources

  Commands:

    n                              Output versions installed
    n latest                       Install or activate the latest node release
    n -a x86 latest                As above but force 32 bit architecture
    n lts                          Install or activate the latest LTS node release
    n <version>                    Install node <version>
    n use <version> [args ...]     Execute node <version> with [args ...]
    n bin <version>                Output bin path for <version>
    n rm <version ...>             Remove the given version(s)
    n prune                        Remove all versions except the active version
    n --latest                     Output the latest node version available
    n --lts                        Output the latest LTS node version available
    n ls                           Output the versions of node available
    n uninstall                    Remove the installed node and npm

  Options:

    -V, --version   Output version of n
    -h, --help      Display help information
    -q, --quiet     Disable curl output (if available)
    -d, --download  Download only
    -a, --arch      Override system architecture

  Aliases:

    which   bin
    use     as
    list    ls
    -       rm
    stable  lts
标签:
node

相关文章

如何设置 nodejs 的环境变量

在前端开发过程中,我们需要对 application 运行的环境进行设置,一般会包括开发环境development,生产环境production,每个环境可以对应不同的一些配置,例如不同环境下请求的地址...

谈谈Node.js与JavaScript的差异

Javascript是一种web前端语言,主要用于web开发中,由浏览器解析执行。Node.js是一个可以快速构建网络服务及应用的平台,是用Javascript语言构建的服务平台。

npm install安装报错怎么解决?

解决方法:1、报“operation not permitted”错误,通过“npm i 包名 --no-optional”解决;2、报“Missing: chromedriver”错误,表示没有安装chromedriver,安装一下即可。

怎么使用npm下载vue.js?

使用npm下载vue.js的方法:1、安装node.js和npm;2、安装cnpm;3、使用命令cnpm install -g vue-cli来安装即可。

vue.js和node.js是什么关系?

vue.js和node.js并没有关系,vue.js是前端框架,算是js的三大框架之一吧,node.js是后端开发语言,同php、java、c#一样的。但是他们可以配合使用。

返回分类 返回首页