question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Having a remote named something other than 'origin' breaks `lerna publish`

See original GitHub issue

Expected Behavior

In a project with a default branch named something other than 'master', and/or a default remote named something other than 'origin', I should be able to lerna publish without receiving an error.

Current Behavior

Attempting lerna publish yields the following error:

❯ excmd master ⟰  lerna publish       
lerna notice cli v3.20.2
lerna info current version 1.0.0-secondary-rollup-package.0
lerna ERR! ENOREMOTEBRANCH Branch 'master' doesn't exist in remote 'origin'.
lerna ERR! ENOREMOTEBRANCH If this is a new branch, please make sure you push it to the remote first.

Possible Solution

Providing a flag to disable the ENOREMOTEBRANCH checks, or better yet, not hardcoding any assumptions at all about branch/remote names into the tool, would be ideal. ❤️

Steps to Reproduce (for bugs)

lerna.json

{
   "packages": ["packages/*"],
   "command": {
      "bootstrap": {
         "hoist": true,
         "strict": true,
         "nohoist": ["bs-*", "ppx-*", "**/bs-*", "**/ppx-*"]
      },
      "run": {
         "stream": true
      }
   },
   "version": "1.0.0-secondary-rollup-package.0"
}

Executable Version
lerna --version 3.20.2
npm --version 6.14.5
node --version v12.16.0
OS Version
NAME VERSION
macOS Big Sur 11.1

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:6
  • Comments:9

github_iconTop GitHub Comments

1reaction
rbirkgitcommented, Jul 1, 2022

“–git-remote xxx” solved it for me. With it I was able to use a different remote name than origin.

0reactions
mantou132commented, Feb 27, 2022

I have the same problem, my reason is the same name of Tag

Read more comments on GitHub >

github_iconTop Results From Across the Web

Having a remote named something other than 'origin' breaks `lerna ...
In a project with a default branch named something other than 'master' , and/or a default remote named something other than 'origin' ,...
Read more >
JavaScript Monorepos with Lerna - Semaphore CI
Publishing your packages. Publishing a package is a two-step process. First, Lerna pushes all the changes to the remote repository and creates ...
Read more >
How To Set Up GitHub Actions to Publish a Lerna Monorepo
This will throw if authentication is broken lerna publish will push ... name: Configure CI Git User run: | git remote rm origin...
Read more >
Publish Multiple Gatsby Sites in a Monorepo, Using Lerna ...
You may have to run git remote remove origin so you can point the code ... origin git@github.com:<account-name>/lerna-monorepo-starter.git.
Read more >
Troubleshooting | Lerna
Make sure to commit all the changes you have in your lerna project, before importing any packages using lerna import . Publish Command​....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found