Git Product home page Git Product logo

sinopia's Introduction

sinopia - a private/caching npm repository server

npm version badge travis badge downloads badge

It allows you to have a local npm registry with zero configuration. You don't have to install and replicate an entire CouchDB database. Sinopia keeps its own small database and, if a package doesn't exist there, it asks npmjs.org for it keeping only those packages you use.

Use cases

  1. Use private packages.

    If you want to use all benefits of npm package system in your company without sending all code to the public, and use your private packages just as easy as public ones.

    See using private packages section for details.

  2. Cache npmjs.org registry.

    If you have more than one server you want to install packages on, you might want to use this to decrease latency (presumably "slow" npmjs.org will be connected to only once per package/version) and provide limited failover (if npmjs.org is down, we might still find something useful in the cache).

    See using public packages section for details.

  3. Override public packages.

    If you want to use a modified version of some 3rd-party package (for example, you found a bug, but maintainer didn't accept pull request yet), you can publish your version locally under the same name.

    See override public packages section for details.

Installation

# installation and starting (application will create default
# config in config.yaml you can edit later)
$ npm install -g sinopia
$ sinopia

# npm configuration
$ npm set registry http://localhost:4873/

# if you use HTTPS, add an appropriate CA information
# ("null" means get CA list from OS)
$ npm set ca null

Now you can navigate to http://localhost:4873/ where your local packages will be listed and can be searched.

Docker

A Sinopia docker image is available

Chef

A Sinopia Chef cookbook is available at Opscode community source: https://github.com/BarthV/sinopia-cookbook

Puppet

A Sinopia puppet module is available at puppet forge source: https://github.com/saheba/puppet-sinopia

Configuration

When you start a server, it auto-creates a config file.

Adding a new user

npm adduser --registry http://localhost:4873/

This will prompt you for user credentials which will be saved on the Sinopia server.

Using private packages

You can add users and manage which users can access which packages.

It is recommended that you define a prefix for your private packages, for example "local", so all your private things will look like this: local-foo. This way you can clearly separate public packages from private ones.

Using public packages from npmjs.org

If some package doesn't exist in the storage, server will try to fetch it from npmjs.org. If npmjs.org is down, it serves packages from cache pretending that no other packages exist. Sinopia will download only what's needed (= requested by clients), and this information will be cached, so if client will ask the same thing second time, it can be served without asking npmjs.org for it.

Example: if you successfully request [email protected] from this server once, you'll able to do that again (with all it's dependencies) anytime even if npmjs.org is down. But say [email protected] will not be downloaded until it's actually needed by somebody. And if npmjs.org is offline, this server would say that only [email protected] (= only what's in the cache) is published, but nothing else.

Override public packages

If you want to use a modified version of some public package foo, you can just publish it to your local server, so when your type npm install foo, it'll consider installing your version.

There's two options here:

  1. You want to create a separate fork and stop synchronizing with public version.

    If you want to do that, you should modify your configuration file so sinopia won't make requests regarding this package to npmjs anymore. Add a separate entry for this package to config.yaml and remove npmjs from proxy_access list and restart the server.

    When you publish your package locally, you should probably start with version string higher than existing one, so it won't conflict with existing package in the cache.

  2. You want to temporarily use your version, but return to public one as soon as it's updated.

    In order to avoid version conflicts, you should use a custom pre-release suffix of the next patch version. For example, if a public package has version 0.1.2, you can upload 0.1.3-my-temp-fix. This way your package will be used until its original maintainer updates his public package to 0.1.3.

Compatibility

Sinopia aims to support all features of a standard npm client that make sense to support in private repository. Unfortunately, it isn't always possible.

Basic features:

  • Installing packages (npm install, npm upgrade, etc.) - supported
  • Publishing packages (npm publish) - supported

Advanced package control:

  • Unpublishing packages (npm unpublish) - supported
  • Tagging (npm tag) - not yet supported, should be soon
  • Deprecation (npm deprecate) - not supported

User management:

  • Registering new users (npm adduser {newuser}) - supported
  • Transferring ownership (npm owner add {user} {pkg}) - not supported, sinopia uses its own acl management system

Misc stuff:

  • Searching (npm search) - supported in the browser client but not command line
  • Starring (npm star, npm unstar) - not supported, doesn't make sense in private registry

Storage

No CouchDB here. This application is supposed to work with zero configuration, so filesystem is used as a storage.

If you want to use a database instead, ask for it, we'll come up with some kind of a plugin system.

Similar existing things

  • npm + git (I mean, using git+ssh:// dependencies) - most people seem to use this, but it's a terrible idea... npm update doesn't work, can't use git subdirectories this way, etc.
  • reggie - this looks very interesting indeed... I might borrow some code there.
  • shadow-npm, public service - it uses the same code as npmjs.org + service is dead
  • gemfury and others - those are closed-source cloud services, and I'm not in a mood to trust my private code to somebody (security through obscurity yeah!)
  • npm-registry-proxy, npm-delegate, npm-proxy - those are just proxies...
  • Is there something else?

sinopia's People

Contributors

barthv avatar crispyconductor avatar einfallstoll avatar estliberitas avatar iambrandonn avatar jeremymoritz avatar jirutka avatar jondlm avatar josephg avatar kfatehi avatar kodypeterson avatar maxlaverse avatar prssn avatar rafacesar avatar rlidwka avatar speier avatar tarun1793 avatar tcort avatar vstone avatar yannickcr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sinopia's Issues

don't allow arbitrary tags

A crafted request like this:

PUT /sinopia/user%2frepo HTTP/1.1
accept: application/json
content-type: application/json
content-length: 7
Connection: keep-alive

"0.6.0"

Can cause an invalid tag to be inserted, and cause issues in npm later.

Not a big deal unless you're using github dependencies with a package name that doesn't exist in repository.

trouble with ca

We should specify a list of CA valid for both local thing AND npmjs... :(

npm http 200 https://localhost/sinopia/express
npm http GET https://registry.npmjs.org/express/-/express-3.2.6.tgz
npm ERR! fetch failed https://registry.npmjs.org/express/-/express-3.2.6.tgz

npm publish --tag always adds latest && publishConfig

Seems like the publish behaviour is always to add dist-tag latest.
This is the same in real npm-www but there you can override it with publishConfig.
It there anyway to set the npm install --tag to override latest? or at least honor publishConfig as npm-www does.

See npm/npm#4837

Express dependency issue

I'm unable to install sinopia due to broken dependency with Express. I get the following:

npm ERR! Error: No compatible version found: express@'^3.4.7'
npm ERR! Valid install targets:
npm ERR! ["0.14.0","0.14.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","2.0.0","2.1.0","2.1.1","2.2.0","2.2.1","2.2.2","2.3.0","2.3.1","2.3.2","2.3.3","2.3.4","2.3.5","2.3.6","2.3.7","2.3.8","2.3.9","2.3.10","2.3.11","2.3.12","2.4.0","2.4.1","2.4.2","2.4.3","2.4.4","2.4.5","2.4.6","2.4.7","2.5.0","2.5.1","2.5.2","2.5.3","2.5.4","2.5.5","2.5.6","2.5.7","2.5.8","2.5.9","2.5.10","2.5.11","3.0.0","3.0.1","3.0.2","3.0.3","3.0.4","3.0.5","3.0.6","3.1.0","3.1.1","3.1.2","3.2.0","3.2.1","3.2.2","3.2.3","3.2.4","3.2.5","3.2.6","3.3.0","3.3.1","3.3.2","3.3.3","3.3.4","3.3.5","3.3.6","1.0.0-beta","1.0.0-beta2","1.0.0-rc","1.0.0-rc2","1.0.0-rc3","1.0.0-rc4","2.0.0-beta","2.0.0-beta2","2.0.0-beta3","2.0.0-rc","2.0.0-rc2","2.0.0-rc3","3.0.0-alpha1","3.0.0-alpha2","3.0.0-alpha3","3.0.0-alpha4","3.0.0-alpha5","3.0.0-beta1","3.0.0-beta2","3.0.0-beta3","3.0.0-beta4","3.0.0-beta6","3.0.0-beta7","3.0.0-rc1","3.0.0-rc2","3.0.0-rc3","3.0.0-rc4","3.0.0-rc5","3.3.7","3.3.8","3.4.0","3.4.1","3.4.2","3.4.3","3.4.4","3.4.5","3.4.6","3.4.7","3.4.8","4.0.0-rc1","4.0.0-rc2"]

Perhaps Express changed upstream recently?

Contracting of version numbers

https://registry.npmjs.org/esprima-fb/2001.1001.0000-dev-harmony-fb

This specific package/version seems to end up in the toplevel sinopia package.json as

"2001.1001.0-dev-harmony-fb": {
"name": "esprima-fb",
"description": "Facebook-specific fork of the esprima project",
"homepage": "https://github.com/facebook/esprima/tree/fb-harmony",
"main": "esprima.js",
"bin": {
"esparse": "./bin/esparse.js",
"esvalidate": "./bin/esvalidate.js"
},
"version": "2001.1001.0-dev-harmony-fb",

it looks like Sinopia is altering the version number and shortening 0000 to 0

on_publish hooks

Need a config option to execute a custom script (deployment thingy) when a package is published.

Requesting a tarball directly without previously requesting the package json fails

We noticed this because we had multiple sinopias behind a load balancer where NPM would get the toplevel on one instance and request the tgz directly on another. Although your normal use case probably doesn't account for load balancers, I would think it's possible that someone clearing out their sinopia cache will experience clients requesting a tarball without first asking for the package json or otherwise attempt to manually download tarball links.

Ideally it should check if it has the package first and pull from upstream otherwise.

Can you confirm? Would you prefer us to PR fixes, do you want to address it, or would this be a won'tfix/won'tmerge?

Object x.x.x has no method 'trim'

 http  --> 304, req: 'GET https://registry.npmjs.org/underscore', bytes: 0/0

/usr/local/lib/node_modules/sinopia/node_modules/semver/semver.js:268
  var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
                  ^
TypeError: Object 1.5.2 has no method 'trim'
    at new SemVer (/usr/local/lib/node_modules/sinopia/node_modules/semver/semver.js:268:19)
    at compare (/usr/local/lib/node_modules/sinopia/node_modules/semver/semver.js:424:10)
    at Function.gte (/usr/local/lib/node_modules/sinopia/node_modules/semver/semver.js:473:10)
    at /usr/local/lib/node_modules/sinopia/lib/local-storage.js:157:14
    at /usr/local/lib/node_modules/sinopia/lib/local-storage.js:116:3
    at /usr/local/lib/node_modules/sinopia/lib/local-fs.js:186:6
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)

Storage separation between public cached modules and private modules

Stored public modules are just for cache. Private modules are critic and must be backuped in order to completely restore sinopia if a anything happend.

At the moment, I think that Sinopia store all modules in the same storage directory.
Is it planned? Or is it just possible without big change?

Thanks

"shasum check failed" when trying to install grunt-karma through sinopia

I am getting a "shasum check failed" error when I try to install grunt-karma through sinopia. These are the steps I am using to reproduce it:

sudo npm install -g sinopia
sudo sinopia

In another terminal:
sudo npm --registry http://localhost:4873/ install grunt-karma

This is the error I get:
npm ERR! Error: shasum check failed for /home/iambrandonn/tmp/npm-2251-t4kF0HXV/1385055608176-0.16491078841499984/tmp.tgz
npm ERR! Expected: 03726561bc268f2e5444f54c665b7fd4a8c029e2
npm ERR! Actual: 5deb6b4cf7b15a5e86ba577c02df380e5edb6904
npm ERR! at /usr/bin/node10.21/lib/node_modules/npm/node_modules/sha/index.js:38:8
npm ERR! at ReadStream. (/usr/bin/node10.21/lib/node_modules/npm/node_modules/sha/index.js:85:7)
npm ERR! at ReadStream.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:920:16
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 3.11.0-13-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "--registry" "http://localhost:4873/" "install" "grunt-karma"
npm ERR! cwd /home/iambrandonn/temp
npm ERR! node -v v0.10.21
npm ERR! npm -v 1.3.11

If I don't install through sinopia it works fine.

Getting user anonymous error even if user is set

Getting this error:

➜  widgetgit:(master) ✗ npm publish
npm ERR! publish Failed PUT response 403
npm ERR! Error: user anonymous not allowed to publish it : widget
npm ERR!     at RegClient.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:272:14)
npm ERR!     at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/index.js:148:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/index.js:891:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/index.js:842:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:920:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Darwin 12.3.0
npm ERR! command "node" "/usr/local/bin/npm" "publish"
npm ERR! cwd /Users/paolo.delmundo/Opower/paolo-delmundo/widget
npm ERR! node -v v0.10.17
npm ERR! npm -v 1.3.8
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/paolo.delmundo/Opower/paolo-delmundo/widget/npm-debug.log
npm ERR! not ok code 0

However, If I do npm whoami, I get:

admin

Allow user to configure fallback registry

Sinopia keeps its own small database and, if a package doesn't exist there, it asks npmjs.org for it keeping only those packages you use.

Can we allow the user to configure the fallback registry?

Non-anonymous users rejected from downloading packages unless they are in config.yaml

I've found that anonymous users ("npm adduser" has not yet been run) are allowed to download packages from Sinopia... which is what I would expect. However, I've also found that if a user has run "npm adduser", possibly because of using registry.npmjs.org instead of Sinopia, AND that user is not set up in the config file... the user is rejected from even downloading packages. I would expect rejection for publishing, but not downloading.
I see two possible solutions. If the basic_auth middleware were placed lower in index.js after all the routes that accept anonymous users but before any route that required auth... that might solve the problem. The other idea is to not fail a request immediately on bad auth, but let the route check when and if the user is needed. At that point the request could fail if anonymous users are not ok.
I am willing to work on either solution and submit a PR if you like, but want to get your opinion before putting any work into it.

Semantic version issues

Your latest patch still dies on semantic version tags for grunt. Please consider changing semver.compare to semver.compareLoose in two places in storage.js.

500 error parsing grunt JSON files

Sinopia seems to be having trouble handling most of the grunt related json files at this time.

It causes a 500 internal error and server restart.

I think it may be related to strictness/interpretation of JSON.

no such file or directory '../package.yaml'

Error: ENOENT, no such file or directory '../package.yaml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.readFileSync (fs.js:284:15)
    at Object.<anonymous> (/home/alex/applications/sinopia/node_modules/sinopia/bin/sinopia:6:28)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

htpasswd and registering users

Feature request.

The main reason for not having registration right now is the fact that we can't modify config file to add new users.

Maybe another file would solve this. htpasswd maybe? There are a few tools that work with it already.

Use proxy to reach uplink repos

I use sinopia for a private repo hosted on our company servers and I need to pass through a proxy to reach public servers. As it is sinopia is not able to send requests for the public npm registry on my server.

If you are not interested in implementing this feature for now, could you please point me in the right direction to do it (where the request to uplinks are sent, especially when we GET dependencies of a module)

Add package.json to the repository

Hi,

Can you add the package.json file to the repository?
That way people can install directly from the repo, because sometimes the version on npmjs.org is outdate, like now, there's a bug on dist-tags.

I was working on the fix, when I saw that you already fixed it with the latest changes, so thank you ;)

better documentation for packages

from the current documentation it is very unclear how to limit specific new users you have created to a specific package(or prefix). In addition does "all" mean anyone (authenticated or not) or all authenticated, is there even an option for the later? there may be some other specifics that are not documented in the readme that i have not thought of or are in other sections too.

'npm install' fails when registry.npmjs.org is unreachable

I found sinopia while researching the best way to mirror the npm registry, and I'm running into an issue that may stem from my misunderstanding of npm. Please forgive me if there's a more appropriate place for this.

I've got sinopia up and running perfectly on an Ubuntu VM, and I can successfully download the modules defined in my project's package.json. However, I noticed that there are still some GET requests that are hitting registry.npmjs.org. I looked into some of the package.json files used by plugins in my node_modules directory, and I noticed lines like this:

  "_from": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.2.0.tgz",
  "_resolved": "https://registry.npmjs.org/grunt-contrib-uglify/-/grunt-contrib-uglify-0.2.0.tgz"

These match the URLs being hit when I run 'npm install'. There are several more.

I experimented with what would happen if I made registry.npmjs.org unreachable (by turning off my network card). My next 'npm install' failed with "fetch failed" errors on each of the registry.npmjs.org URLs.

Any suggestions would be much appreciated.

Edit:

It looks like I neglected to consider what effect the presence of an npm-shrinkwrap.json file would have. After removing the file, my issue looks resolved.

where does the cached packages live?

I can't seem to find them anywhere. Not sure if they are cached at all. I am using the default config.yaml. storage is set at ./storage. The directory is empty after i do a npm install. I thought sinopia will cache the npm packages my app uses here.

How to install or publish restricted page?

I have my admin user setup and the generated password in sinopia. How do I now install or publish a package?

Does npm use _auth and email from the .npmrc file? so is email=admin then?

Add support for custom storage backends

Your README states:

If you want to use a database instead, ask for it, we'll come up with some kind of a plugin system.

I'd like to run sinopia on Heroku, which doesn't have a persistent filesystem. I haven't used sinopia yet at all -- how hard would it be to add support for something like S3, postgres, redis, or otherwise?

Latest Development is Default

When running "npm install express" it is fetching 4.0.0-rc2 - This is the development version. When running "npm install express" against default registry I get version 3.4.8 - the latest stable as expected.

Download package failed after sinopia config registry

I start with install sinopia version 0.4.3 and it finish well.Then, I configured the registry as: npm set registry http://localhost:4873/
So after that I tried to download some package and it didn't work and i have got that;

C:\Users\tuto>npm install grunt
npm http GET http://localhost:4873/grunt
npm http 407 http://localhost:4873/grunt
npm ERR! TypeError: Cannot call method 'match' of undefined
npm ERR! at RegClient. (C:\Program Files\nodejs\node_modules\npm
node_modules\npm-registry-client\lib\request.js:119:29)
npm ERR! at cb (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-re
gistry-client\lib\request.js:158:9)
npm ERR! at RegClient. (C:\Program Files\nodejs\node_modules\npm
node_modules\npm-registry-client\lib\request.js:252:14)
npm ERR! at Request.self.callback (C:\Program Files\nodejs\node_modules\npm
node_modules\request\request.js:129:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request. (C:\Program Files\nodejs\node_modules\npm\no
de_modules\request\request.js:873:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage. (C:\Program Files\nodejs\node_module
s\npm\node_modules\request\request.js:824:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at streamreadable.js:920:16
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install" "grunt"
npm ERR! cwd C:\Users\tuto
npm ERR! node -v v0.10.19
npm ERR! npm -v 1.3.11
npm ERR! type non_object_property_call
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\tutp\npm-debug.log
npm ERR! not ok code 0

So what Iam supposed to do???

win64/node 0.10.25 : sinopia fails to start

Sinopia is crashing when starting from the cli on node 0.10.25/win64:

It seems like it should call process.getuid, not process.getuid():

$sinopia

Error:
c:\Users\USER\AppData\Roaming\npm\node_modules\sinopia\lib\cli.js:3
if (process.getuid() === 0) {
^
TypeError: Object # has no method 'getuid'
at Object. (c:\Users\georg.zoeller\AppData\Roaming\npm\node_modules\sinopia\lib\cli.js:3:13)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (c:\Users\georg.zoeller\AppData\Roaming\npm\node_modules\sinopia\bin\sinopia:3:1)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)

request entity too large

since npm is now uploading package using just one big json, 1mb default limit isn't enough

maybe make it configurable, like nginx's client_max_body_size

registry error parsing json

This message appears as soon as i do my first npm install from the root of my application (after installing sinopia and running it, a)
Of course, If i set npm registry back to npmjs.org, it works fine.

remember unreachable links

If a package contains version with a tarball we didn't succeed in downloading in previous 5 minutes or so (because of remote server failure or 404), we shouldn't include this version to a result.

So user can run npm install foo multiple times and get less and less versions until he successfully gets a tarball.

Please add a license

Hi Alex, I love this project - it's exactly what I was looking for =]

Would you be able to put up a license for usage?

All the best, Lee

crash on uplink error + client disconnect

Rarely happens, but smells like a bug:

 http  --> ERR, req: 'GET http://registry.npmjs.org/multiparty/-/multiparty-2.2.0.tgz', error: ESOCKETTIMEDOUT
 warn  --> host registry.npmjs.org is now offline
 error --- unexpected error: ESOCKETTIMEDOUT
Error: ESOCKETTIMEDOUT
    at ClientRequest.<anonymous> (/tmp/sinopia/node_modules/request/request.js:688:19)
    at ClientRequest.g (events.js:175:14)
    at ClientRequest.EventEmitter.emit (events.js:92:17)
    at Socket.emitTimeout (http.js:1797:10)
    at Socket.g (events.js:175:14)
    at Socket.EventEmitter.emit (events.js:92:17)
    at Socket._onTimeout (net.js:327:8)
    at Timer.unrefTimeout [as ontimeout] (timers.js:412:13)
 fatal --- uncaught exception, please report this
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:691:11)
    at ServerResponse.res.setHeader (/tmp/sinopia/node_modules/express/node_modules/connect/lib/patch.js:63:22)
    at ServerResponse.res.set.res.header (/tmp/sinopia/node_modules/express/lib/response.js:527:10)
    at ServerResponse.res.send (/tmp/sinopia/lib/middleware.js:131:8)
    at ServerResponse.res.report_error (/tmp/sinopia/lib/index.js:77:10)
    at ReadTarball.<anonymous> (/tmp/sinopia/lib/index.js:165:15)
    at ReadTarball.EventEmitter.emit (events.js:117:20)
    at ReadTarball.<anonymous> (/tmp/sinopia/lib/storage.js:258:12)
    at ReadTarball.EventEmitter.emit (events.js:117:20)
    at Request.<anonymous> (/tmp/sinopia/lib/up-storage.js:271:10)

proxy_publish loops

If two servers set up to upload packages to each other, and we try to upload it, servers get stuck in a loop.

We should first upload it locally, and only after that forward request to uplinks. Fallback using #3 if fails.

npm search _something_ doesn't work

If I execute: npm search _my_package_ it gives me an error:

npm ERR! SyntaxError: Unexpected token C
npm ERR! Cannot GET /-/all/since?stale=update_after&startkey=1386675384891
npm ERR!
npm ERR! at Object.parse (native)
npm ERR! at RegClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:235:23)
npm ERR! at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/index.js:142:22)
npm ERR! at Request.EventEmitter.emit (events.js:98:17)
npm ERR! at Request. (/usr/local/lib/node_modules/npm/node_modules/request/index.js:856:14)
npm ERR! at Request.EventEmitter.emit (events.js:117:20)
npm ERR! at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/index.js:808:12)
npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR! at _stream_readable.js:895:16
npm ERR! at process._tickCallback (node.js:415:13)

It seems that the output from sinopia is not compatible with the parser of npm-search (I only tried with a non-existent package, I can't test with an existing one right now).
This are my current versions:

node --version
v0.10.5

npm --version
1.2.18

sinopia --version
0.5.5

Can't install [email protected]

I tried to install [email protected] throw npm install -g [email protected] behind my company proxy as npm set proxy http://companyproxy;port/ and with npm set registry https://registry.npmjs.org/, so it failed with error : npm ERR not ok code 0

this what i get in npm-debug log file:
4033 silly lockFile 4bf1555c-forever-agent-0-5-0 [email protected]
4034 silly lockFile 4bf1555c-forever-agent-0-5-0 [email protected]
4035 verbose tar unpack C:\Users\tuto\AppData\Roaming\npm-cache\aws-sign2\0.5.0\package.tgz
4036 silly lockFile 86a86559-pm-cache-aws-sign2-0-5-0-package tar://C:\Users\tuto\AppData\Roaming\npm-cache\aws-sign2\0.5.0\package
4037 verbose lock tar://C:\Users\tuto\AppData\Roaming\npm-cache\aws-sign2\0.5.0\package C:\Users\tuto\AppData\Roaming\npm-cache\86a86559-pm-cache-aws-sign2-0-5-0-package.lock
4038 silly lockFile 4cb30b29-ache-aws-sign2-0-5-0-package-tgz tar://C:\Users\tuto\AppData\Roaming\npm-cache\aws-sign2\0.5.0\package.tgz
4039 verbose lock tar://C:\Users\tuto\AppData\Roaming\npm-cache\aws-sign2\0.5.0\package.tgz C:\Users\tuto\AppData\Roaming\npm-cache\4cb30b29-ache-aws-sign2-0-5-0-package-tgz.lock
4040 silly lockFile fa463915-forever-agent-0-5-0 forever-agent@0.5.0
4041 silly lockFile fa463915-forever-agent-0-5-0 forever-agent@0.5.0
4042 silly gunzTarPerm extractEntry .travis.yml
4043 silly lockFile 4a472fed-75016-0-7573030390776694-package tar://C:\Users\TUTO
1\AppData\Local\Temp\npm-3912-4sbmSknC\1386843775016-0.7573030390776694\package
4044 silly lockFile 4a472fed-75016-0-7573030390776694-package tar://C:\Users\TUTO
1\AppData\Local\Temp\npm-3912-4sbmSknC\1386843775016-0.7573030390776694\package
4045 silly gunzTarPerm modes [ '755', '644' ]
4046 silly lockFile 12c3f96f-e-range-parser-0-0-4-package-tgz tar://C:\Users\tuto\AppData\Roaming\npm-cache\range-parser\0.0.4\package.tgz
4047 silly lockFile 12c3f96f-e-range-parser-0-0-4-package-tgz tar://C:\Users\tuto\AppData\Roaming\npm-cache\range-parser\0.0.4\package.tgz
4048 error Error: ENOENT, chmod 'C:\Users\TUTO1\AppData\Local\Temp\npm-3912-4sbmSknC\1386843776277-0.3609538197051734\package\README.md'
4049 error If you need help, you may report this log at:
4049 error http://github.com/isaacs/npm/issues
4049 error or email it to:
4049 error [email protected]
4050 error System Windows_NT 6.1.7601
4051 error command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
4052 error cwd C:\Users\tuto\AppData\Roaming\npm\node_modules\sinopia
4053 error node -v v0.10.19
4054 error npm -v 1.3.11
4055 error path C:\Users\TUTO
1\AppData\Local\Temp\npm-3912-4sbmSknC\1386843776277-0.3609538197051734\package\README.md
4056 error fstream_path C:\Users\TUTO~1\AppData\Local\Temp\npm-3912-4sbmSknC\1386843776277-0.3609538197051734\package\README.md
4057 error fstream_type File
4058 error fstream_class FileWriter
4059 error fstream_finish_call chmod
4060 error code ENOENT
4061 error errno 34
4062 error fstream_stack C:\Program Files\nodejs\node_modules\npm\node_modules\fstream\lib\writer.js:305:19
4062 error fstream_stack Object.oncomplete (fs.js:107:15)
4063 verbose exit [ 34, true ]

can any one help me plzz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.