LoginSignup
6
4

More than 3 years have passed since last update.

npm でライブラリをアンインストールする方法

Last updated at Posted at 2020-12-27

npm でインストールしたライブラリをアンインストールする方法をメモします。

書き方

npm uninstall パッケージ名

package.jsonのdevDependenciesが下記だったとする

package.json
{
  "name": "npm uninstall",
  "version": "0.1.0",
  "private": true,
  "scripts": {
  },
  "dependencies": {
  },
  "devDependencies": {
    "@types/node": "^14.14.14",
    "@types/react": "^17.0.0",
    "@types/react-dom": "^17.0.0",
    "prettier": "2.2.1",
    "tslint-config-prettier": "^1.18.0",
    "tslint-plugin-prettier": "^2.3.0",
    "tslint-react": "^5.0.0",
    "typescript": "^4.1.3"
  }
}

「prettier」をアンインストールしたい場合は下記のように書く

npm uninstall prettier

npm install したときは、--save-devとかが必要だったけど、uninstallするときはいらないみたい。(2020/12/28時点)

6
4
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
6
4