This repository has been archived by the owner on Jun 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 744
Deploy a private npm registry in 5 minutes
fengmk2 edited this page Feb 3, 2015
·
20 revisions
- Install
cnpmjs.org
andcnpm
from npm
$ npm install -g --build-from-source cnpmjs.org cnpm sqlite3
If you're in China, maybe you should use China mirror
$ npm install -g --build-from-source \
--registry=http://registry.npm.taobao.org \
--disturl=http://npm.taobao.org/mirrors/node
cnpmjs.org cnpm sqlite3
- Start
cnpmjs.org
server with configs- admins:
fengmk2,dead-horse
- scopes:
my-company-name,other-name
- default ports: 7001-registry, 7002-web
- admins:
$ nohup cnpmjs.org start --admins='fengmk2,dead-horse' --scopes='@my-company-name,@other-name' &
- Change
cnpm
default registry to your private registry
$ cnpm set registry http://localhost:7001
- Use
cnpm
to login yourself on your private registry
$ cnpm login
Username: fengmk2
Password: ***
Email: (this IS public) m@fengmk2.com
- Publish your private package now!
$ cd /tmp
$ mkdir helloworld && cd helloworld
$ cnpm init
name: (helloworld) @my-company-name/helloworld
version: (1.0.0)
{
"name": "@my-compny-name/helloworld",
"version": "1.0.0",
"description": "my first scoped package",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
$ cnpm publish
+ @my-company-name/helloworld@1.0.0
- View your private package
You can visit with bowsers
$ open http://localhost:7002/@my-company-name/helloworld
Or use cnpm info
$ cnpm info
Copyright @ 2013 - present cnpmjs.org