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?

More than 1 year has passed since last update.

JavaScript npm

Posted at

npmとは

①パッケージの管理をしてくれる

そのプロジェクトで、必要なライブラリやパッケージを容易にインストールすることを可能にする

②依存関係を管理してくれている

package.jsonに記載されている情報をもとに、
必要なバージョンを正確に、一括でインストールすることを可能にする

任意のディレクトリで npm init を実行し、package.json を作成

npm init

の実行結果、

This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.

と表示され、その後、終わるまで、Enterを押し続けると、package.jsonが作成される

任意のパッケージをインストール

npm install express

package.json 及び package-lock.json に追記されていることを確認

npm list
cat package.json
less package.json
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?