Version: Gitlab Core 13.9
I’m trying to publish an npm package to Gitlab package repository. I’ve followed all the steps in the relevant doc npm packages in the Package Registry | GitLab
.npmrc
strict-ssl=false
@group-name:registry=https://gitlab.customdomain.com/api/v4/projects/347/packages/npm/
//gitlab.customdomain.com/api/v4/projects/347/packages/npm/:_authToken=XXXXXXXXX
The authToken is a GitLab Deploy Token with read_package_registry and write_package_registry permissions under the package project (ie project #347). This package is located in the “@group-name” group, such that the URL to access it is “https://gitlab.customdomain.com/group-name/package-repository”
package.json
{
"name": "@group-name/my-package",
"version": "1.0.0",
...
"publishConfig": {
"@group-name:registry": "https://gitlab.customdomain.com/api/v4/projects/347/packages/npm/"
},
}
Running the command npm publish
returns this error after a long timeout (50 seconds or so)
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://gitlab.customdomain.com/api/v4/projects/347/packages/npm/@group-name%2my-package - 404 Not Found
npm ERR! 404
npm ERR! 404 '@group-name/my-package@1.0.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
As far as I can tell, this configuration is identical to what’s suggested in the Gitlab docs, but it doesn’t work. Have also tried using Yarn instead of NPM and no luck.
What’s baffling is I’m able to publish a Python Pypi package to the same project with no issues whatsoever. I followed the instructions in PyPI packages in the Package Registry | GitLab . Here’s the .pypirc file I’ve used for that:
[distutils]
index-servers =
gitlab
[gitlab]
repository = https://gitlab.customdomain.com/api/v4/projects/347/packages/pypi
username = gitlab+deploy-token-6
password = XXXXXXX
And the package shows up OK
Thoughts? Completely out of ideas here.