ch1. Node.js
Node.js는 chrome V8 JavaScript 엔진으로 빌드된 JavaScript 런타임.(프로그래밍 언어가 동작하는 환경!)
nvm(node version manager)
구글검색: nvm-windows- https://github.com/coreybutler/nvm-windows - download now - nvm-setup.zip
nvm ls
nvm으로 node.js 설치
nvm install 12.14.1
nvm으로 사용할 node버전 선택
nvm use 12.14.1
잘 사용되는지 확인
node --version
사용하지 않는 버전 삭제
nvm uninstall 12.21.0
도움말 확인
nvm --help
vscode에서 터미널-npm init -y
-package.json생성 - main은 삭제
npm install parcel-bundler -D
$ npm install lodash
node_modules삭제-npm i
npm install -D xxx: 개발용 의존성 패키지 설치
npm install xxx: 일반 의존성 설치
개발 서버 실행과 빌드
$ parcel index.html
-package.json-scripts-test삭제-"dev": "parcel index.html"
-$ npm run dev 개발서버 열기
-main.js - import from 'lodash';
-console.log(.camelCase("hello world"));
-package.json-"dev": "parcel index.html",
"build": "parcel build index.html"
-$ npm run build
유의적 버전(SemVer=Semactic Versioning)
Major.Minor.Patch
12.14.1
vscode-터미널- $ npm info lodash
$ npm install lodash@4.17.20
npm update lodash
$ npm install lodash@4.17.20
NPM 프로젝트의 버전 관리(.gitignore)
npm run build
-새 파일 .gitignore
.cache/
dist/
node_modules/
-git init~...~commit
깃허브-new repository- $ git remote add origin https://github.com/lillly02v/test.git
-git push origin main