npm update 명령어로는 package.json의 dependencies의 한도 내에만 update가 수행된다.
의존성이 훼손되지 않는 선에서 최신 버전으로 업데이트를 하고 싶다면 npm-check-updates를 사용하면 된다.
npm-check-updates는 package.json의 dependencies와 devDependencies에 기록되어있는 패키지들을
현재기준 최신버전으로 업데이트 시켜준다.
$ npm install -g npm-check-updates
$ ncu
Checking package.json
[====================] 5/5 100%
express 4.12.x → 4.13.x
multer ^0.1.8 → ^1.0.1
react-bootstrap ^0.22.6 → ^0.24.0
react-a11y ^0.1.1 → ^0.2.6
webpack ~1.9.10 → ~1.10.5
Run ncu -u to upgrade package.json
$ ncu -u
Upgrading package.json
[====================] 1/1 100%
express 4.12.x → 4.13.x
Run npm install to install new versions.
$ npm install # update installed packages and package-lock.json
Direct dependencies are updated to the latest stable version:
Range operators are preserved and the version is updated:
"Less than" is replaced with a wildcard:
"Any version" is preserved:
Prerelease and deprecated versions are ignored by default.
With --target minor, only update patch and minor:
With --target patch, only update patch:
npm 홈페이지 - 바로가기