NPM Registry Doesn't work with Yarn
Yarn requires that package registries return dist-tags as well as versions, but the package repository doesn't return dist-tags.
Steps to reproduce
- Enable Package Repositories
- Publish a package to your GitLab repository
- Attempt to use yarn (1.13.0) to install package (specifying the version)
Any package will cause the issue.
What is the current bug behavior?
yarn errors out due to https://github.com/yarnpkg/yarn/blob/v1.13.0/src/resolvers/registries/npm-resolver.js#L43
What is the expected correct behavior?
GitLab could do one or better:
- At least return an empty dist-tags to be a standard response
- GitLab should at least support the @Latest flag (mapping it to the latest version)
- GitLab should support adding and removing tags: https://docs.npmjs.com/cli/dist-tag
Output of checks
This bug happens on GitLab.com
The presenter could be easily modified for potential correct behavior 1 or 2: https://gitlab.com/gitlab-org/gitlab-ee/blob/master/ee/app/presenters/npm_package_presenter.rb
Not supporting the @Latest flag in the npm package repository does mean that the npm repository can only be used when specifying the version in the add command. It would be really nice for that to work.