好的,所以我终于设法使用Sinopia获得私人npm注册表.但我无法发表任何内容.
TL; DR:Sinopia不支持npm adduser,但有自己的用户管理.此外,npm需要在 通过npm adduser 发布npm之前创建的有效用户,该用户失败,因为内部Sinopia服务器在不支持的命令中抛出错误....
概要:
Sinopia不依赖于Couch.DB,并且会从主服务器中获取它尚未拥有的包(默认为全局npmjs.org).
Sinopia完美启动并配置为侦听所有接口.它为包裹提供了奇迹
npm install
Run Code Online (Sandbox Code Playgroud)
我甚至将〜/ .npmrc配置为始终指向内部注册表.
所有项目的package.json文件都设置为
....
"publishConfig" : {
"registry" : "http://internal-npm:4873"
},
....
Run Code Online (Sandbox Code Playgroud)
我还设法通过在js-yaml的帮助下操作config.yaml来在sinopia中添加自定义用户
crypto.createHash('sha1').update('theBigPassword').digest('hex')
Run Code Online (Sandbox Code Playgroud)
现在我被困在了
npm --registry=http://internal-npm:4873 --ca=null publish
Run Code Online (Sandbox Code Playgroud)
经过漫长的等待,我得到:
npm ERR! need auth auth and email required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`
npm ERR! System Linux 3.11.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "--registry=http://internal-npm:4873" "--ca=null" "publish"
npm …Run Code Online (Sandbox Code Playgroud)