Npm Basic - redutan/redutan.github.io GitHub Wiki

์˜์กด์„ฑ์„ local์— ์ถ”๊ฐ€

$ npm install underscore

์˜์กด์„ฑ์„ ์ „์—ญ์— ์ถ”๊ฐ€

$ npm install -g underscore

ํŠน์ • ๋ฒ„์ „์˜ ์˜์กด์„ฑ์„ ์ถ”๊ฐ€

$ npm install [email protected]

package.json ์ƒ์„ฑ $ npm init

package.json์— ์˜์กด์„ฑ ์ •๋ณด๋ฅผ ์ถ”๊ฐ€ํ•˜๋ฉด์„œ ์˜์กด์„ฑ ์ถ”๊ฐ€

$ npm install --save underscore

after

  "dependencies": {
    "underscore": "^1.8.3"
  },

package.json์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์˜์กด์„ฑ ์ „์ฒด ์ถ”๊ฐ€

$ npm install

package.json์— ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ์˜์กด์„ฑ ์ถ”๊ฐ€

$ npm install --save-dev babel-core

after

  "devDependencies": {
    "babel-core": "^6.26.0",
  }

์‹คํ–‰ $ node test.js