I'm trying to upload an npm package to a GitLab registry for the first time. I set the scope and the npm config entries according to the documentation, but when I execute npm publish
, I get the following error:
npm notice Publishing to https://git.myorg.com/api/v4/projects/123/packages/npm/
npm ERR! code E404
npm ERR! 404 Not Found - PUT https://git.myorg.com/api/v4/projects/123/packages/npm/@myscope/myproject
npm ERR! 404
npm ERR! 404 '@myscope/[email protected]' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
So I try to publish it, and the error says it doesn't exist and that I should publish it...what?!
From the last two lines it looks like the error is meant for an installation failure, but I have definitely used npm publish
. Also, in the PUT
command, the final slash between scope and project name is replaced with /
. No idea why that happened and why it happened nowhere else, but maybe that is a symptom of the underlying issue?
CodePudding user response:
Ok, it was my own fault. I put in the ID of the Group and not the project I wanted to publish to. It's the only project in the group and we use the group just for the package registry project, so I got them confused.
I'm not sure if I should delete this question or leave it open.