Zi 字媒體
2017-07-25T20:27:27+00:00
Managing Node.js Version with NVM
Ubuntu:20.04
Node.js:v10.19.0
NVM:v0.36.0
Node.js 的版本更新很快,在開發過程中,可能會遇到不同專案需要不同版本的問題,因此我們可以利用 NVM 來做 Node.js 的版本切換。
Installation
由於 NVM 尚未被包進 apt-list 裡,可以根據 NVM 官方文件上提供的安裝 script 透過 curl 方式安裝。
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
安裝 script 會寫入一些路徑參數到你的 shell 的 config 裡,因此要再 reload 一次
source ~/.bashrc
Notice: 此範例以 bash 為主。
Usage
基本使
; 查看有哪些版本可以使用
nvm list-remote
; 安裝 latest version
nvm install node
; 切換已安裝的版本
nvm use v12.19.0
; 取得該版本的 node bin
nvm which v12.19.0
Categories: Node.js
Tags: Node.js
分類
Android
AngularJS
API Blueprint
Chrome
Database
MySQL
DataStructure
Docker
Editor
Vim
Firefox
Git
GitLab
Google API
Hadoop
HTTP
Language
Go
Java
JavaScript
jQuery
jQueryChart
Node.js
Vue
Vue-CLI
PHP
Laravel
Lumen
ZendFramework
Python
Mac
Network
Cisco
DLink
Juniper
Oauth
Server
Apache
Share
Unix
FreeBSD
Linux
WebDesign
Bootstrap
CSS
HTML
Wordpress
Search
搜尋關鍵字:
寫了
5860316篇文章,獲得
23313次喜歡