npmjs.org packages on sinopia

282 Views Asked by At

After setting up sinopia, How to install npmjs.org packages on it? Scoped too.

I have tried and succeeded setting up sinopia and even publish my packages.

But did not find any documentation about installing from npmjs.org

2

There are 2 best solutions below

0
On

To answer your question first you have to understand how sinopia works.

Sinopia is just a private registry that as act as a proxy to cache packages from a remote registry, npmjs.org, yarn registry or another sinopia (or verdaccio). In other words, you cannot install packages directly, basically are cached when you perform an npm install in your project pointing to a sinopia registry.

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

After such installation looking in the local storage you will find packages downloaded from the uplinks. This process is handled automatically by your private registry and I do not you recommend modifying any metadata otherwise will corrupt the cache.

I wrote documentation for verdaccio which is a sinopia's fork and backward compatible which might give you an idea how to set up correctly and a brief definition of each part of the private registry.

http://www.verdaccio.org/docs/en/what-is-verdaccio.html

0
On

Anyone facing this weird issue, where all packages other than the ones start '@' are installing via public NPM registry but just the ones starting with '@' are are not installing.

For example 'backbone' or 'jquery' is installing but '@angular/cli' is not installing, please update the sinopia configuration file, and append the packages:'@*/*' property with the following entry for 'proxy',

packages:
  '@*/*':
    # scoped packages
    access: $all
    publish: $authenticated
    proxy: npmjs

Link to above details