node.js

진성대·2023년 3월 28일
0

Front-End

목록 보기
4/15

NVM (Npm version manager)

  • nvm arch [32|64]: Show if node is running in 32 or 64 bit mode. Specify 32 or 64 to override the default architecture.
  • nvm check: Check the NVM4W process for known problems.
  • nvm current: Display active version.
  • nvm install <version> [arch]: The version can be a specific version, "latest" for the latest current version, or "lts" for the most recent LTS version. Optionally specify whether to install the 32 or 64 bit version (defaults to system arch). Set [arch] to "all" to install 32 AND 64 bit versions. Add --insecure to the end of this command to bypass SSL validation of the remote download server.
  • nvm list [available]: List the node.js installations. Type available at the end to show a list of versions available for download.
  • nvm on: Enable node.js version management.
  • nvm off: Disable node.js version management (does not uninstall anything).
  • nvm proxy [url]: Set a proxy to use for downloads. Leave [url] blank to see the current proxy. Set [url] to "none" to remove the proxy.
  • nvm uninstall <version> : Uninstall a specific version.
  • nvm use <version> [arch] :Switch to use the specified version. Optionally use latest, lts, or newest. newest is the latest installed version. Optionally specify 32/64bit architecture.nvm use <arch>will continue using the selected version, but switch to 32/64 bit mode. For information about using use in a specific directory (or using .nvmrc), please refer to issue #16.
    -nvm root <path>: Set the directory where nvm should store different versions of node.js. If <path> is not set, the current root will be displayed.
  • nvm version: Displays the current running version of NVM for Windows.
  • nvm node_mirror <node_mirror_url>: Set the node mirror.People in China can use https://npmmirror.com/mirrors/node/
  • nvm npm_mirror <npm_mirror_url>: Set the npm mirror.People in China can use https://npmmirror.com/mirrors/npm/

window 용 nvn https://github.com/coreybutler/nvm-windows


parce-bundler -D

npm install parcel-bundler -D : 개발용 의존성
npm install lodash : 일반 의존성

-D dev dependency에 설치 하는 flag - 개발용 의존성 패키지 설치

개발용 의존성 패키지 설치란?

  • 개발할때만 사용하고 일반적으로 웹 브라우저에 사용할 때는 필요가 없음

npm install 을 사용하면 node_modules에 package 가 추가 된다.
node_modules를 삭제 한다 하더라도 다시 npm install을 하면 한번 설치한 패키지는 내역으로 남게 되고 그걸 바탕으로 다시 추가 된다.

package.json은 직접적으로 관리를 할 수 있지만 package-lock.json은 직접 관리할 수 가 없다.


유의적 버전(Semantic Versioning, SemVer)

Major.Minor.Patch

  • E.g, 12.14.1

Major : 기존 버전과 호환되지 않는 새로운 버전.

Minor : 기존 버전과 호환되는 새로운 기능이 추가된 버전.

Patch : 기존 버전과 호환되는 버그 및 오타 등이 수정된 버전.

^ : Major 버전 안에서 가장 최신 버전으로 업데이트 가능

npm install lodash@4.17.20
npm update lodash
profile
신입 개발자

0개의 댓글