반응형

npm

기본 명령어

// 현재 폴더를 npm pacakge로 관리하는 프로젝트로 만듬
$ npm init

// package 다운로드
$ npm install

// npm으로 현재 앱(프로젝트) 실행
$ npm start

React 관련 명령어

// 'my-app'이라는 React 앱을 만든 후 실행하는 프로세스
$ npx create-react-app my-app
$ cd my-app
$ npm start

// React Router를 사용하기 위해 package 설치하는 명령어
npm install react-router-dom

부가 기능 명령어

// chart.js 사용하기 위한 package 설치
$ npm intall chart.js

// swiper framework 사용하기 위한 package 설치
$ npm intall swiper

// sass 사용하기 위한 package 설치
$ npm install node-sass

 

yarn

기본 명령어

 It is recommended to install Yarn through the npm package manager, which comes bundled with Node.js when you install it on your system.

 Once you have npm installed you can run the following both to install and upgrade Yarn.

// npm을 이용하여 yarn package manager 설치하기
$ npm install --global yarn

// yarn 시작, 프로젝트를 시작할 때, 초기화 할때 ( package.json 을 생성합니다. )
$ yarn init

// 패키지 의존성 모듈 설치
$ yarn
(or)
$ yarn install

// yarn 버전 체크
$ yarn --version

// yarn으로 현재 앱 실행하기
$ yarn start

// 이 명령어는 현재 설치된 패키지들의 의존성을 분석하여 사용하지 않는 불필요한 파일들을 제거해줌
// 이 명령어를 실행하면, .yarnclean 파일이 생성되며 version control에 추가해야함.
$ yarn clean

 

모듈 관련 명령어

 

 

 

출처

- Yarn 사용법

velog.io/@ddusi/Linux-4

 

- npm command docs (공식사이트)

docs.npmjs.com/cli/v7/commands

 

- yarn command docs (공식사이트)

classic.yarnpkg.com/en/docs/cli/

 

반응형

'Build' 카테고리의 다른 글

gradlew 설정  (0) 2020.12.23