首先,分享一下,nexus的说明文档。nexus官网的文档说明这个连接中的help,打开,而后右侧有个能够打开的连接Repository Management With Nexus - free comprehensive book,打开后,你会发现这里是不一样版本的文档说明,以下图。node
而后能够选择你正在试用的Nexus Repository Manager的版本进行查看,咱们使用的是3.0版本的,而后在第10章是专门介绍npm私服的。npm
这里面一共有3中类型的npm仓库:ide
Proxying npm Registries 代理仓库grunt
To reduce duplicate downloads and improve download speeds for your developers and CI servers, you should proxy the registry hosted at https://registry.npmjs.org. By default npm accesses this registry directly. You can also proxy any other registries you require.
大体的意思就是说,能够访问远程仓库的一些代码,好比angular的代码测试
Private npm Registries 托管仓库ui
A private npm registry can be used to upload your own packages as well as third-party packages. You can create a private npm registry by setting up a hosted repository with the npm format in the repository manager. It is good practice to create two separate hosted repositories for these purposes.
大体的意思是说,这是你的私服,能够放你要放到本身的npm私服上的代码this
Grouping npm Registries 存储库组(不知道这样翻译怎么样)命令行
A repository group is the recommended way to expose all your npm registries repositories from the repository manager to your users, without needing any further client side configuration. A repository group allows you to expose the aggregated content of multiple proxy and hosted repositories with one URL to npm and other tools.
这是一个综合性的库组,能够将请两个综合起来,下面有详细的介绍。翻译
建立Proxying npm Registries 代理仓库。3d
建立Proxying npm Registries hosted本地仓库。
建立 Grouping npm Registries 综合仓库
到这里,已经完成了50%了。好了,咱们来看一下,建立好的npm私服。
接下来,咱们须要配置一下npm
到这里,npm的私服建立完毕,接下来,咱们要验证一下了。
随便在一个目录下,进入cmd,而后执行npm –loglevel info install grunt,看看是够可以下载成功,只是下载成功是不够,还要看下,是否是从你的npm私服中进行下载的。
下图是下载成功,在对应目录下会多一个文件node_modules,注意,你须要删除,由于是测试的
还须要验证是不是从npm私服中下载的。
ok。到这里结束了,个人泪啊,但愿能给你帮助!