sinopia icon indicating copy to clipboard operation
sinopia copied to clipboard

Can't install packages from @types

Open aspirisen opened this issue 8 years ago • 10 comments

Hello, I have an issue when i try to install smth from types user my_name is not allowed to access package @types/abs : @types/abs

It works if i revert registry url to https://registry.npmjs.org/, it looks like sinopia doesn't proxy all packages. In console:

http  --> 404, req: 'GET https://registry.npmjs.org/%40types%2Fabs', bytes: 0/70
http  <-- 404, user: my_name, req: 'GET /@types%2fabs', error: no such package available

Thanks.

aspirisen avatar Oct 18 '16 13:10 aspirisen

This works https://github.com/rlidwka/sinopia/issues/421#issuecomment-246621676 but it is not a good solution

aspirisen avatar Oct 19 '16 10:10 aspirisen

Use this fork, under npm sinopia2. It works for me!

akinnear avatar Oct 30 '16 19:10 akinnear

sinopia2 also Doesn't work

arfeifei avatar Nov 02 '16 13:11 arfeifei

You can override the registry for specific scopes, if that's the easiest workaround. For example:

npm config set @types:registry https://registry.npmjs.org/

That would tell npm to always get anything for the @types scope directly from the official server on the internet, bypassing Sinopia entirely. Obviously it won't be the right fix for everyone. npm would need internet access (via a proxy if necessary) and there won't be any centralised caching.

ghost avatar Nov 04 '16 12:11 ghost

@aspirisen solution did not work for me :(

Edit:

It does work, just needed to also add the following to my configuration yaml file

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

jennasalau avatar Nov 07 '16 04:11 jennasalau

@jennasalau to make it work you have to change sources https://github.com/rlidwka/sinopia/blob/master/lib/up-storage.js

aspirisen avatar Nov 07 '16 09:11 aspirisen

does it work with https://github.com/verdaccio/verdaccio ?

atais avatar Nov 10 '16 13:11 atais

@atais Thanks! It works.

jinkwon avatar Feb 05 '17 02:02 jinkwon

@jennasalau, Your solution works

edit configuration yaml :

packages: '@/': # scoped packages access: $all allow_access: $all allow_publish: $authenticated

access: $all

publish: $authenticated

proxy: npmjs

meiliujun avatar Sep 19 '17 03:09 meiliujun

In my case, make .npmrc file.

registry="http://my-private-registry.com"
@types:registry="https://registry.npmjs.org"
@babel:registry="https://registry.npmjs.org"

Then, all modules starting with @ are downloaded from https://registry.npmjs.org.

SangHakLee avatar Oct 26 '18 07:10 SangHakLee