Skip to content

Instantly share code, notes, and snippets.

@SangHakLee
Last active April 4, 2018 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SangHakLee/9513672e133c1027bc06a80c993d7025 to your computer and use it in GitHub Desktop.
Save SangHakLee/9513672e133c1027bc06a80c993d7025 to your computer and use it in GitHub Desktop.
NPM private registry my-module.js
{
"name": "my-module",
"version": "1.1.0",
"description": "NPM private registry my-module.js",
"main": "index.js",
"scripts": {
},
"repository": {
"type": "git",
"url": "https://gist.github.com/SangHakLee/9513672e133c1027bc06a80c993d7025"
},
"publishConfig": {
"registry": "http://10.222.222.227:4873"
},
"author": "sanghak,lee <code.ryan.lee@gmail.com>",
"license": "MIT"
}
@SangHakLee
Copy link
Author

package.json에서 "publishConfig": {"registry": "http://10.222.222.227:4873"} 옵션이 있기 때문에
$ npm publish 요청시 http://registry.npmjs.org가 아닌 http://10.222.222.227:4873으로 publish한다.

만약, package.json에 해당 옵션을 주지 않으면 npm set registry http://10.222.222.227:4873 명령으로 registry를 변경 후 publish 한다.

이 경우 앞으로 모든 npm 요청이 set registry로 설정한 서버로 가기 때문에 public 모듈을 설치할 때 다시 npm set http://registry.npmjs.org 해줘야하는 번거로움이 있다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment