프로그래밍/node.js

[npm] npm uninstall

znvlcm 2022. 5. 19. 09:12

이 내용은 npm help uninstall를 통해 확인한 공식 문서의 해석입니다. 

사용법

npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|--no-save]

 

설명 (해석)

원문

This uninstalls a package, completely removing everything npm installed on its behalf.
It also removes the package from the dependencies, devDependencies, optionalDependencies, and peerDependencies objects in your package.json.
Futher, if you have an npm-shrinkwrap.json or package-lock.json, npm will update those files as well.
--no-save will tell npm not to remove the package from your package.json, npm-shrinkwrap.json, or package-lock.json files.
--save or -S will tell npm to remove the package from your package.json, npm-shrinkwrap.json, and package-lock.json files. This is the default, but you may need to use this if you have for instance save=false in your npmrc file
In global mode (ie, with -g or --global appended to the command), it uninstalls the current package context as a global package. --no-save is ignored in this case.
Scope is optional and follows the usual rules for scope.
  • 이 명령어는 지정한 패키지를 npm이 패키지를 대신하여 설치했던 모든 것을 완벽하게 제거합니다. 
  • 또한, package.json에서 dependencies, devDependencies, optionalDependencies, 그리고 peerDependencies으로부터 해당 패키지를 제거합니다. 
  • 더하여, 만약 npm-shrinkwrap.json 또는 package-lock.json이 존재한다면 이 파일들도 갱신합니다. 
  • --no-save 옵션은 npm-shrinkwrap.json 또는 package-lock.json에서 해당 패키지를 지우지 않도록 합니다.
  • --save || -S 옵션은  package.json, npm-shrinkwrap.json, and package-lock.json files. 모두에서 해당 패키지를 지우도록 합니다. 이 옵션은 별도의 지정이 없다면 자동으로 적용되는 디폴트옵션이지만, 당신의 npmrc파일에 save=false로 설정되어 있다면, 별도로 설정해야할 수 있습니다. 
  • -g || --global 옵션은 전역패키지인 current package context에서 해당 패키지를 삭제합니다. 이 경우 --no-save옵션이 무시됩니다. 
  • Scope은 선택적이고 스코프를 위한 통상적인 규칙을 따릅니다.
728x90

'프로그래밍 > node.js' 카테고리의 다른 글

[npx] npx  (0) 2022.05.19
[npm] npm update  (0) 2022.05.19
[프레임워크] Express.js  (0) 2022.04.18
Node.js  (0) 2021.09.03
[npm] npm install 옵션  (0) 2021.07.27