Unable to login / push package to NPM repo

Problem:
Unable to login / push package to NPM repo.

Expected outcome:
Login succeeds, package uploaded.

Pulpcore version:
3.78.0

Pulp plugins installed and their versions:
|ansible|0.25.1|
|certguard|3.78.0|
|container|2.25.1|
|core|3.78.0|
|deb|3.5.2|
|file|3.78.0|
|gem|0.7.1|
|maven|0.10.1|
|npm|0.3.3|
|ostree|2.4.8|
|python|3.15.0|
|rpm|3.30.0|

Other relevant data:
Hi,

I’m currently evaluating Pulp. One area of functionality I’m particularly interested in is NPM support, but I haven’t been able to find much in the documentation / announcements / issues. My understanding at the moment is:

Not working / supported:

  • pulp-cli integration
  • pulp-ui integration

Working:

  • pull-through cache. I’ve set up a remote / repo for registry.npmjs.org and this seems to work with npm e.g. npm install --registry http://<base_url>/pulp/content/npm-proxy envinfo

Uncertain:

  • Publication of own packages. The documentation of the plugin and the available API endpoints seem to suggest that this is supported, but I have been unable to get it to work. I tried:
$ npm publish --registry http://<base_url>/pulp/content/npm-repo
npm notice
npm notice 📦  hello-world@1.0.1
npm notice Tarball Contents
npm notice 58B index.js
npm notice 161B package.json
npm notice Tarball Details
npm notice name: hello-world
npm notice version: 1.0.1
npm notice filename: hello-world-1.0.1.tgz
npm notice package size: 279 B
npm notice unpacked size: 219 B
npm notice shasum: 5f140475ee596b1eaa5aefe3dd403035c2d98159
npm notice integrity: sha512-zpK8Cpb+vMW2u[...]Kbm0fRUcuADcQ==
npm notice total files: 2
npm notice
npm error code ENEEDAUTH
npm error need auth This command requires you to be logged in to http://<base_url>/pulp/content/npm-repo
npm error need auth You need to authorize this machine using `npm adduser`
npm error A complete log of this run can be found in: /home/vscode/.npm/_logs/2025-06-11T14_20_02_126Z-debug-0.log

So I tried to login, but neither npm login / adduser seem to be supported (same result in either case):

$ npm login --registry http://<base_url>/pulp/content/npm-repo-dist   
npm notice Log in on http://<base_url>/pulp/content/npm-repo-dist
Username: admin
Password: 

npm error code E405
npm error 405 Method Not Allowed - PUT http://<base_url>/pulp/content/npm-repo-dist/-/user/org.couchdb.user:admin
npm error A complete log of this run can be found in: /home/vscode/.npm/_logs/2025-06-11T15_04_42_416Z-debug-0.log

I confess to being slightly confused as to exactly what the URL paths should be and whether I should be using the repo URL or the distribution URL, so I have tried various different ones:

http://<base_url>/pulp/content/npm/npm-repo-dist
http://<base_url>/pulp/content/npm/npm/npm-repo-dist
http://<base_url>/pulp/content/npm-repo
http://<base_url>/pulp/content/npm/npm-repo
http://<base_url>/pulp/content/npm/npm/npm-repo

Having concluded that possibly the plugin does not have complete support for NPM, I decided to try uploading a package through the Pulp API using curl, referring to the document here REST API - Pulp Project. However I was not successful:

curl -X POST http://<base_url>/pulp/api/v3/content/npm/packages/ \
-u "admin:<admin_password>" -F "file=@./hello-world-1.0.1.tgz" \
-F "metadata={\"repository\":\"/pulp/api/v3/repositories/npm/npm/0197558d-b1f0-7f52-8634-fb2f4452bfce/\",\"relative_path\":\"hello-world-1.0.1.tgz\",\"name\":\"hello-world\",\"version\":\"1.0.1\"}" \
-v

Authentication succeeds but I receive the following vague error:

<!doctype html>
<html lang="en">
<head>
  <title>Server Error (500)</title>
</head>
<body>
  <h1>Server Error (500)</h1><p></p>
</body>
</html>

Could you let me know if the pulp-npm plugin supports authentication and package upload using the npm client and if so, suggest where I might be going wrong?

Regards,

Rob

Hi @robert-smith-maersk. Hey, glad to know that you’re using the pulp_npm plugin.
Sadly we didn’t implemented the authentication and package upload support yet. We have a ticket opened for that, but it’s not a high priority for us right now.

Feel free to contribute with code or anything else. We’ll review any contribution to the project.

Regards,

2 Likes

Thanks for the confirmation @decko. It’s a bit of a catch-22 for me at the moment - if my organisation does begin using Pulp, it would be with a view to becoming active contributors on the less mature (or non-existent) plugins such as NPM, UI or NuGet. But that first step of getting Pulp deployed in the org is dependent on my being able to show that there’s enough mature, stable functionality there that we can use straight away (in Pulp core and the Maven, Python and File plugins). Unfortunately I’ve only been granted a short period of time to try Pulp out and the results are more likely to be limited by my ability to comprehend the docs and get up to speed quickly as by the state of Pulp itself :exploding_head:

I’m now moving on from NPM and looking at those other plugins, starting with Python. Having some issues setting up a PyPi pull-through cache atm, but it looks like I may simply need to update to a more recent version https://github.com/pulp/pulp_python/issues/842

Anyway thanks again for the help, I’ll make another post if I get completely stuck :slightly_smiling_face:

2 Likes