sinopia
sinopia copied to clipboard
Can't install packages from @types
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.
This works https://github.com/rlidwka/sinopia/issues/421#issuecomment-246621676 but it is not a good solution
sinopia2 also Doesn't work
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.
@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 to make it work you have to change sources https://github.com/rlidwka/sinopia/blob/master/lib/up-storage.js
does it work with https://github.com/verdaccio/verdaccio ?
@atais Thanks! It works.
@jennasalau, Your solution works
edit configuration yaml :
packages: '@/': # scoped packages access: $all allow_access: $all allow_publish: $authenticated
access: $all
publish: $authenticated
proxy: npmjs
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.