npm: Node Package Manager

  • npm init: 프로젝트 초기화
  • npm install: package.json의 패키지를 현재 프로젝트(local. node_moduels)에 설치
    • –ignore-scripts 스크립트 실행 차단(공급자 공격 방지)
    • –save package: 패키지를 프로젝트 의존성(dependencies)으로 추가
    • –save-dev package, -D package: 패키지를 프로젝트 개발 의존성(devDependencies)으로 추가. 운영빌드시 배포안됨
    • –save-prod package, -P package: 패키지를 프로젝트 운영으로 추가.
    • –global, -g: 패키지를 전역 수준으로 추가.
    • –legacy-peer-deps: 기존 버전을 다 무시하고 설치
    • –force: package-lock.jso에 몇가지 다른 의존 버전들을 추가하면서 설치
  • npm uninstall -save pakcage: 패키지 삭제
  • npm update –save: 프로젝트 패키지 업데이트
  • npm ci 의존성 설치(고정)
  • npm run script_name: package.json의 scripts에 지정 명령 실행
  • npm run start
  • npm cache clean: 캐시 삭제
  • npm exec: 패키지 실행 npx
  • npm fund: 의존성 트리 확인
  • npm config: 설정 확인
  • npm config set KEY VALUE 설정
  • npm config get KEY 확인
  • npm config delete KEY
  • npm config list
    • –json

help (windows)

(depreated)

  • npm start: Starts the develpoment server.
  • npm run build: Bundles the app into sttic files for production.
  • npm test: Starts the test runner.
  • npm run eject: 숨겨져 있는 설정 파일을 밖으로 내보냄(롤백불가) Removes this tool and copies build dependencies, configuration files and scripts into the app directory. If you do this, you can’t go back!
  • npm install –global <color #7092be>npm@latest: npm 업데이트
  • npm init PACKAGE: create-가 붙은 패키지를 검색(npx create-PACKAGE)
  • npm init vite: create-vite를 통한 vite 구성(npx create-vite)
  • npm init vue@latest: create-vue를 통한 vue 구성(npx create-vue)
  • npm init next: create-next-app를 통한 next 구성(npx create-next-app)
  • npm create vite@latest {path} –template react: vite를 통한 react를 path에 생성(create-react-app 중지됨)
  • node.js/npm.txt
  • 마지막으로 수정됨: 2026/04/29 08:37
  • 저자 writer