본문 바로가기
Node.js

[Node.js] package.json에서 안쓰는 패키지 삭제하기

by 메이플 🍁 2022. 5. 15.

사용하고 싶지 않은 모듈을 dependencies에서 삭제해준다

{
  "name": "test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "parcel-bundler": "^1.12.5",
    "sass": "^1.51.0"
  },
  "scripts": {
    "dev": "parcel index.html",
    "build": "parcel build index.html"
  },
  "dependencies": {
    "@popperjs/core": "^2.11.5",
    "bootstrap": "^5.1.3",
    "regenerator-runtime": "^0.13.9"
  }
}

 

@popperjs/core와 bootstrap 삭제

{
  "name": "test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "devDependencies": {
    "parcel-bundler": "^1.12.5",
    "sass": "^1.51.0"
  },
  "scripts": {
    "dev": "parcel index.html",
    "build": "parcel build index.html"
  },
  "dependencies": {
    "@popperjs/core": "^2.11.5",
  }
}

 

터미널에서 패키지 다시 설치해주기

npm

npm install

yarn

yarn install

댓글