3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Volta使ってみた

Last updated at Posted at 2021-07-28

NodeとNPMのバージョン管理ツールが出たみたいなので試してみた
試した環境はDocker内 Debian 10 (buster)

nコマンドとか他にもバージョン管理できるツールあるけど、このVoltaはpackage.jsonにバージョンが記載されて、Git管理できるのがいいみたい。

公式サイト:https://volta.sh/

Download / Install volta

curl https://get.volta.sh | bash

The above command will add the following to .bashrc.

export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"

Install / Pin Node and NPM

source ~/.bashrc
volta install node@14.17.3
volta install npm@6.14
volta pin node@14.17.3
volta pin npm@6.14

The above command will add the following to package.json

    "volta": {
        "node": "14.17.3",
        "npm": "6.14.14"
    }

For other engineers

Other engineers just pull the package.json and run npm install, it is going to install the pinned version of NodeJs and NPM.

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?