1
1

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 3 years have passed since last update.

npm コマンドのチートシート

Last updated at Posted at 2022-08-24

npmのコマンドの覚書

package.jsonを対話方式で作成する
npm init
作成したpackage.jsonのdependenciesおよびdevDependenciesからパッケージインストール
npm install
npm i
個別パッケージをインストール、かつpackage.jsonのdependenciesに書き込み
npm install hogePackage --save
npm i hogePackage -S

rem バージョンを指定する場合はパッケージ名の後に@をつけその後ろにバージョン
npm install hogePackage@1.2.3
npm i hogePackage@1.2.3
個別パッケージをインストール、かつpackage.jsonのdevDependenciesに書き込み
npm install hogePackage --save-dev
npm i hogePackage -D
パッケージのアンインストール
npm uninstall hogePackage
npm un hogePackage
個別パッケージのバージョン確認 
rem ローカル確認
npm info hogePackage versions --local
rem グローバル確認
npm info hogePackage versions --global
rem 最新の確認
npm info hogePackage version
インストールしたパッケージの最新版出ているか確認
npm outdated
キャッシュクリア
npm cache clean --force
1
1
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
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?