Missing HTTP_NPM_SCOPE header when publishing
See original GitHub issueWe are attempting to do a lerna publish to packagecloud.io. The packagecloud.io API is failing with a 422 indicating that the NPM_SCOPE parameter is not set properly. After speaking with one of their engineers, they are expecting that the HTTP_NPM_SCOPE parameter be set properly, and in fact it is not being passed.
Expected Behavior
We are expecting that lerna publish
will publish to packagecloud.io.
Current Behavior
We are told that the HTTP_NPM_SCOPE
parameter is not being set by lerna, when the publish is being called.
Possible Solution
Can we add that as part of the publish?
Steps to Reproduce (for bugs)
- Have a packagecloud account.
- nvm install (lts/dubnium) (this is node 10.15.3 and npm 6.4.1)
- run npm publish ( It will publish)
- run lerna publish (it will fail with a 422 indicating that the npm-scope variable is missing.)
lerna.json
<!-- Please paste your `lerna.json` here -->
{
"packages": [
"dev/*"
],
"npmClient": "npm",
"command": {
"publish": {
"yes": true,
"ignoreChanges": [
"*.md",
"*.spec.js"
]
}
},
"useWorkspaces": true,
"version": "independent"
}
lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->
Context
We want to use lerna to publish and maintain a monorepo. We can’t publish. Everything else works great, lerna version, lerna bootstrap, lerna list - but the publish doesn’t work.
Your Environment
Executable | Version |
---|---|
lerna --version |
3.13.1 |
npm --version |
6.4.1 |
yarn --version |
1.12.3 |
node --version |
10.15.3 |
OS | Version |
---|---|
ubuntu | 14.04 |
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Problems publishing scoped module · Issue #12194 - GitHub
Hello, I'm having problems publishing the scoped package @parametric-svg/spec (and ... 404 tarball, folder, http url, or git url. npm ERR!
Read more >Error publishing a new version of a package in npm
These are simple way to install package : Publish your package to npm Make a new directory outside of your project and cd...
Read more >npm-publish - npm Docs
Description. Publishes a package to the registry so that it can be installed by name. By default npm will publish to the public...
Read more >How to troubleshoot NPM problems - JFrog
How to troubleshoot NPM problems · Using curl · NPM Login · NPM Install (Non-scoped) · NPM install (Scoped Packages) · NPM Publish...
Read more >Ubuntu Manpage: npm-registry - The JavaScript Package ...
Yes. When making requests of the registry npm adds two headers with information about your environment: · Npm-Scope – If your project is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! Armando from packagecloud checking in.
After digging into this issue, it looks like what’s happening is that Lerna is passing the full
@scope/package-name
instead of just@scope
tolibnpmpublish
which sets it as theHTTP_NPM_SCOPE
header.https://github.com/lerna/lerna/blob/a7ad9b60d27b390fde21fd2837f2d97320c4603e/utils/npm-publish/npm-publish.js#L34
The official registry supports both
@scope
and@scope/packagename
for HTTP_NPM_SCOPE, but packagecloud does not.From what I understand, this header is supposed to include just the
@scope
for a package.I’m inclined to say that Lerna should only pass the
@scope
tolibnpmpublish
instead of the entire@scope/packagename
, but I’m not familiar with the needs of the project, so I could be wrong.We’re also discussing how to handle this better at packagecloud.
The docs for project-scope are kinda vague on exactly what they should be used for. I’m cool with passing
spec.scope
(fromnpm-package-arg
) there, instead.