• Home
  • About
    • lahuman photo

      lahuman

      열심히 사는 아저씨

    • Learn More
    • Facebook
    • LinkedIn
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

nodejs package.json의 모듈 업데이트 하기!

03 May 2019

Reading time ~1 minute

nodejs package.json의 모듈 업데이트 하기!

npm-check-updates을 이용하여 package.json에 등록된 모듈들을 의존성에 알맞게 최신 버젼으로 업데이트 할 수 있다.

설치 후 실행은 다음과 같다.

# global로 npm-check-updates 설치
$> npm i -g npm-check-updates
# 프로젝트(package.json과 동일한) 디렉토리에서 다음 명령어 실행
$> ncu -u
Upgrading /Users/admin/myProject/package.json
[====================] 17/17 100%

 app-root-path     ^2.1.0  →   ^2.2.1
 cookie-parser     ~1.4.3  →   ~1.4.4
 debug             ~2.6.9  →   ~4.1.1
 dotenv            ^7.0.0  →   ^8.0.0
 express          ~4.16.0  →  ~4.16.4
 express-session  ^1.15.6  →  ^1.16.1
 helmet           ^3.16.0  →  ^3.17.0
 http-errors       ~1.6.2  →   ~1.7.2
 morgan            ~1.9.0  →   ~1.9.1
 puppeteer        ^1.13.0  →  ^1.15.0

Run npm install to install new versions.

# 업데이트된 결과를 설치
$> npm install

자주는 아니더라도, 가끔씩은 모듈을 업데이트 하자!

참고자료

  • How do I update each dependency in package.json to the latest version?
  • npm-check-updates


nodejsupdate Share Tweet +1