node.jsnpmgitlabgitlab-ce

How can I specify and use a specific version of an npm package from GitLab Package Registry in my project?


I have a project hosted on GitLab, and I've successfully published an npm package to the GitLab Package Registry (self-hosted Community Edition).

Now, I need to use a specific version of that package in my project. What is the correct way to specify and include this specific version from the GitLab Package Registry in my npm dependencies?

I did already manage to get the latest version of the package, but not to specify a specific version of the package (e.g. 16.0.0).


Solution

  • It turned out that the local npm cache caused the error.

    The following command did the trick for me:

    npm cache clean --force