> For the complete documentation index, see [llms.txt](https://chenzhihui.gitbook.io/note/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chenzhihui.gitbook.io/note/be/nodejs.md).

# nodejs

安装 nodejs 使用 [nvm](https://github.com/nvm-sh/nvm)&#x20;

nvm 是 nodejs 的版本管理程序

安装 nvm 之后使用，`nvm ls-remote` 查看版本，`nvm install vX.X.X` 安装，`nvm use vX.X.X` 切换 node 版本，`nvm alias default vX.X.X` 设置默认。

为 \~/.bashrc 加上 `export NODE_PATH="$NVM_BIN/../lib/node_modules"` 方便使用全局库
