이 글은 npm이 설치된 환경에서 npm help update로 확인한 문서를 번역한 내용입니다.
사용법
npm update [-g] [<pkg>...]
설명
수행 내용
This command will update all the packages listed to the latest version (specified by the tag config), respecting the semver constraints of both your package and its dependencies (if they also require the same package).
It will also install missing packages.
이 명령어는 리스트의 모든 패키지를 해당 프로젝트의 의존관계와 당신의 패키지 모두의 유의적 버전(semver)제약관계를 고려한 최신버전(태그설정으로 지정된)으로 업데이트합니다.
또한, 유실된 패키지를 설치합니다.
https://semver.org/lang/ko/ 유의적 버전에 관한 설명
주요 옵션
If the -g flag is specified, this command will update globally installed packages.
If no package name is specified, all packages in the specified location (global or local) will be updated.
Note that by default npm update will not update the semver values of direct dependencies in your project package.json, if you want to also update values in package.json you can run: npm update --save (or add the save=true option to a configuration file to make that the default behavior).
만약 -g 플래그를 지정하면, 이 명령어는 설치된 패키지를 전역적으로 업데이트 합니다.
만약에 패키지 이름을 지정하지 않는다면, 지정된 위치의 모든 패키지(지역, 전역포함)들이 업데이트됩니다.
기본적으로 npm update는 프로젝트내 package.json의 직접 의존관계의 semver 값을 업데이트하지 않습니다. package.json의 값도 업데이트하려면 다음을 실행하세요. npm update --save(또는 설정파일에 save를 디폴트로 지정하는 save=true 옵션 추가)
'프로그래밍 > node.js' 카테고리의 다른 글
[툴] npm, npx, yarn (0) | 2022.05.19 |
---|---|
[npx] npx (0) | 2022.05.19 |
[npm] npm uninstall (0) | 2022.05.19 |
[프레임워크] Express.js (0) | 2022.04.18 |
Node.js (0) | 2021.09.03 |