node如何更新?
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本文内容仅供个人学习/研究/参考使用,不构成任何决策建议或专业指导。分享/转载时请标明原文来源,同时请勿将内容用于商业售卖、虚假宣传等非学习用途哦~感谢您的理解与支持!