LoginSignup
2
2

More than 5 years have passed since last update.

npmの使い方

Posted at

-gオプションについて

-gをつけるとグローバルに配置

よく使うコマンド

インストール、アンインストール(実行する前に↓も先に読んで!)

npm install パッケージ
npm uninstall パッケージ

npm install -g パッケージ
npm uninstall -g パッケージ

管理ファイル(package.json)の作成

npm init

package.jsonに追加しつつ、インストール

npm install パッケージ --save-dev

package.jsonに記載されているパッケージをインストール

npm install

インストール済みリストの確認

npm list
npm list -g

package.jsonについて(まだちゃんとまとめてない)

{
  "name": "プロジェクト名",
  "version": "1.0.0",
  "description": "",
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "babel": "^6.5.2",
    "babel-core": "^6.10.4",
    "babel-polyfill": "^6.9.1",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-react": "^6.11.1",
    "babelify": "^7.3.0",
    "browserify": "^13.0.1",
    "glob": "^7.0.5",
    "gulp": "^3.9.1",
    "gulp-util": "^3.0.7",
    "react": "^15.2.1",
    "react-dom": "^15.2.1",
    "vinyl-source-stream": "^1.1.0"
  }
}
2
2
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
2
2