B.2.6 package.json을 이용한 설치

    package.json 파일에서 필요한 패키지명을 작성하고 npm install 명령어를 입력하면 필요한 모든 패키지를 자동으로 설치합니다. package.json에 mysql 모듈을 수동으로 입력합니다.

    package.json 수정

    {

      "name": "microservice",

      "version": "1.0.0",

      "description": "test",

      "main": "index.js",

      "dependencies": {

        "mysql": "^2.15.0"

      },

      "devDependencies": {},

      "scripts": {

        "test": "echo \"Error: no test specified\" && exit 1"

      },

      "author": "microservice",

      "license": "ISC",

      "repository": {

        "type": "git",

        "url": "git"

      },

      "keywords": [

        "test",

        "keyword"

      ]

    }


    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.