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