0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

npm

node package manager = nodeのパッケージ管理ツール
※「パッケージ」=必要なプログラムファイルの塊

パッケージのインストール、アンインストール、パッケージの検索、依存関係の管理、パッケージの公開、スクリプト実行など、様々なことができる。
そもそもプロジェクトに必要なパッケージを人間が1つずつインストールしたり、たくさんあるパッケージ間の依存関係を管理したり、競合しないようにするのは難しいので、npmが使われている。

例:
package.json ファイルに依存関係が記述されている状態で

npm install

を実行すると、必要なパッケージがすべてインストールされる。

npx

node package executer = nodeのパッケージの実行ツール

例:

npx {パッケージ}

で指定したパッケージを実行できる。
なお、未インストールのパッケージでもインストール・実行・インストールしたモジュールの削除まで行ってくれる。

nvm

node version manager = nodeのバージョン管理ツール

Node.jsの複数バージョンを管理することができる。
例えば、今開発しているプロジェクトではNode 13系を使っているけど、プロジェクト外で試したいものがあってNode 18以上が欲しい!という場合など。

例:

nvm install {Node.jsのバージョン}

で指定したバージョンのNode.jsをインストールできる。

nvm use {Node.jsのバージョン}

で指定したバージョンのNode.jsに切り替えられる。

参考記事

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?