用過node的朋友都知道,node版本更新非车馍遥快咬摇,然而開發(fā)用到的node版本不一定會(huì)統(tǒng)一,為了保證環(huán)境一樣煞躬,一個(gè)nodejs包管理非常重要肛鹏。這種包管理器,需要不但能夠快速簡(jiǎn)潔下載各個(gè)版本的node包恩沛,更加需要能夠進(jìn)行版本的切換在扰。
筆者環(huán)境:windows10 64位
筆者適用了 nvm, nvm-windows雷客,n芒珠,以及nodist
前三者都是雖然都用windows版本,但是其兼容性較差搅裙,在筆者環(huán)境中老是出現(xiàn)各種bug皱卓,一番折騰后,仍然不得解部逮。時(shí)間就是生命娜汁,當(dāng)用到nodist之后,感覺非常棒
附上鏈接:
https://github.com/marcelklehr/nodist
以下是nodist的命令兄朋,筆者默默做個(gè)筆記
nodist
Lists installed versions highlighting the active ones.
nodist global 4.x
Sets the global node version requirement
nodist local 4.x
Sets the node version requirement per directory (including all subdirectories).
nodist env 4.x
Sets the node version requirement per terminal.
nodist npm global 3.x
Set global npm version requirement.
nodist npm global match
Tell nodist to always choose the npm version that matches the current node version.
(the current node version may be determined by env, local or global requirements)
nodist npm local 2.x
Set the npm version requirement for the current directory.
nodist npm env 2.x
Set the npm version requirement for the current terminal environment.
call nodist env 4.x
In a batch script use call
.
nodist dist
Lists all available node versions.
nodist + 4.x
Just checks, if the version is installed and installs it if not.
nodist + all
will install everything.
nodist - 4.1.1
Removes a version.
nodist --help