Skip to content

Instantly share code, notes, and snippets.

@aoba17
Last active March 17, 2022 06:19
Show Gist options
  • Save aoba17/0e60b98362bd256c4f5e2f0216991ee9 to your computer and use it in GitHub Desktop.
Save aoba17/0e60b98362bd256c4f5e2f0216991ee9 to your computer and use it in GitHub Desktop.
Ubuntu 18.04 (on WSL) にNPMをインストールしたときのメモ

インストール

sudo apt update
sudo apt install nodejs
sudo apt install npm

バージョンアップ

Node.js

sudo npm cache clean
sudo npm install -g n
sudo n stable

NPM

sudo npm update -g npm

パッケージをインストールする方法

npm install -g [package name]

-g はグローバルインストールを意味する。 汎用的なパッケージは -g をつけてインストールする。 あるプロジェクトのみで使用したいパッケージをインストールしたい場合は、 プロジェクトのディレクトリに移動し -g をつけずにコマンドを実行する。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment