Docs feedback: NPM registry doc -> how to install?
https://docs.gitlab.com/ee/user/project/packages/npm_registry.html
I used this doc successfully to publish a package to Gitlab's private NPM registry. But there's no information in the doc on how to actually consume the package.
I tried running npm set registry <gitlab_url>/api/v4/projects/<project_id>/packages/npm
. This is the same registry uri I used for publishing the package, so this is what I'd expect the registry uri to be for pulling as well, but then I get 404 when trying to npm i @proj/name
(and I also get 404 when trying to install actual NPM packages: I expect the registry to have a fallback to NPM, like verdaccio has for example).
I also tried running npm adduser
before npm install but I'm getting 404 for my username (even though it's the correct username).
I eventually managed to install with npm i <gitlab_url>/<proj>/<name>/-/package_files/<file_id>/download
, but this has 2 issues:
- same url doesn't seem to work with npx for some reason. I get
command not found: download
- I don't want our users to have to resort to this big url. They should be able to set registry once and then just do
npx @proj/name
.
To sum up, the documentation should have information on how to consume the published packages with both npm
and npx
and how to set the registry.