Node.js/npm 정보
[2021-1학기] Node.js Version = 15.12.0, 64-bit, npm Version = 7.6.3: 강의의 연속성을 위해 이 Version만 사용하고 Update하지 않습니다.
[2018-1학기] Node.js Version = 8.9.4, 64-bit, npm Version = 5.6.0
Node.js는 아래 링크에서 무료로 내려받을 수 있다.
- Download: https://nodejs.org/en/download/current/
Node.js upgrade 필요하면 Node.js를 재설치하면 됨
[npm 명령어]
- 도움말: npm help
- Version 확인: npm --version
- 특정한 module을 현재 위치에 설치하기: npm install <package name> 혹은 npm i <package name>
현재 folder에 있는 module 설치하기: npm install
전역으로 특정한 module 설치하기(-g or --global): npm install -g <package name>
package.json에 있는 dependencies에 등록하며 설치(별다른 설정 없으면 기본으로 --save가 동작): npm install --save <package name>
package.json에 있는 devDependencies에 등록하며 설치(-D or --save-dev): npm install --save-dev <package name>
npm 자체를 upgrade: npm install -g npm
package.json과 package-lock.json만을 update: npm i --package-lock-only
- 현재 package build하기: npm build <package folder>
npm install하면 자동으로 npm build를 실행함
- 현재 위치에 설치된 모든 module update: npm update
전역으로 설치된 module update: npm update -g
- scripts 명령어 실행하기: npm run(package.json에 있는 scripts 명령어를 실행)
npm <scripts 명령어>도 가능: 예를 들어 package.json에 start 명령어가 있으면 npm run start 혹은 npm start가 모두 가능함
- Nuxt.js로 만든 web app을 static hosting하기: npm run generate(generate을 실행) 혹은 npm run build
실행하면 dist folder를 생성하고 deploy가 될 수 있게 함
- Nuxt.js로 만든 web app을 compile하고 실행하기: npm run dev
실행 전에 관련된 module install 필요: Nuxt.js folder로 이동하여 npm install 실행
- package.json 생성하기: npm init
- npm 점검
npm audit: npm 문제점 검사
npm audit fix: npm 문제점 수정
- npm 세부 정보: https://www.npmjs.com/
[Node.js 명령어]
- 도움말: node --help
- Version 확인: node --version
- JS 실행: node <your JS file>
- Node.js 정지 원할 때: Ctrl+C 누르기
[Node.js]
- JavaScript 기반으로 구현됨
Package
package.json으로 정의된 folder
Module
require()로 불러들일 수 있는 객체
- Node.js 사용 방법
Node.js 기본 사용법: http://www.pyrasis.com/nodejs/nodejs-HOWTO
Node.js: https://opentutorials.org/module/938
JavaScript (Node.js): https://opentutorials.org/course/2136
- 유용한 예제
8 Node.js Web Socket Libraries For 2018
전국 편의점 위치 표시: http://kay0426.tistory.com/m/3
Cylon.js(Arduino, Leap Motion 제어): https://cylonjs.com/documentation/tutorials/thingscon/
Websocket과 연동(Arduino, Leap Motion 제어): http://xseignard.github.io/2013/06/25/interfacing-leap-motion-with-arduino-thanks-to-nodejs/
[Firebase]
- Homepage: https://firebase.google.com/
- Firebase for Web: https://www.slideshare.net/sungbeenjang/firebase-for-web-3-realtime-database
- Android Chatting App
- Android Social App: http://yookn.tistory.com/244
- Firebase Tutorial: Building a Realtime App with Firebase
- How to authenticate users using Vue.js and Firebase
- How to Manage User State With Vuex and Firebase
- Vue + Firebase Realtime Database
[Amazon Web Services]
- 아마존 웹 서비스를 다루는 기술: 실무에서 필요한 AWS 클라우드의 모든 것!
- 생활코딩: https://opentutorials.org/course/488/2616
- 개발이 하고 싶어요: http://hyeonstorage.tistory.com/category/%3D%3D%20Cloud%20%3D%3D
[Components/Libraries]
- A powerful shopping cart platform for developers
- TOAST UI Chart supports an easy way to draw various and essential charts on your web service.
[Troublesooting]
예전에 설치한 npm이 계속 실행됨
C:\Users\<사용자 이름>\AppData\Roaming 밑에 있는 npm과 관련된 folder를 모두 삭제한다.