develog

[mac] node.js & npm 설치 본문

카테고리 없음

[mac] node.js & npm 설치

냐옴 2022. 1. 27. 14:44
node installer 다운로드 & 설치

https://nodejs.org/ko/download/

 

다운로드 | Node.js

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

nodejs.org

 

brew 로 node 설치
$ brew update
$ brew install node

 

node 설치 확인

 

$ node --version
v17.4.0

$ npm --version
8.3.1

 

npm

프로젝트 초기화

## package.json 이 생성된다
$ npm init
$ npm init -y

디펜던시 설치 & 제거

## 로컬에 설치
$ npm install mocha
## 로컬에서 삭제
$ npm uninstall mocha

## 글로벌에 설치
$ sudo npm install mocha
## 글로벌에서 삭제
$ sudo npm uninstall mocha

## 디펜던시 위치
$ npm install mocha --save-prod
$ npm install mocha --save-dev

디펜던시 설치 목록 조회

## 로컬 설치 목록
$ npm list
$ npm list --depth=0

## 글로벌 설치 목록
$ npm list --global
$ npm list -g
$ npm list -g --depth=0
Comments