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.

lerna publish fails with latest version(v5.0.0)

See original GitHub issue

lerna publish from-package --dist-tag latest --yes --no-verify-access This is the command that is used to publish to npm. This used to work before v5.0.0.

Expected Behavior

Publish packages to npm without any errors.

Current Behavior

The publish command fails at prepare npm lifecycle which internally calls build command. lerna run build --stream does work.

Additional Info: I have multiple packages in the repo. There is a package A that is dependent on package B. The folder name of package B is different from that of the package name mentioned in package.json. In the publish command, it is trying to get the package from npm via folder name instead of package name from package.json which is resulting in 404. It should not be trying to fetch from npm as the version of that package is not yet published. it is just updated with lerna version locally.

This used to work in previous version of lerna. Just updated to latest yesterday and this is broken.

lerna.json

{ "packages": ["packages/*", "apps/*"], "version": "independent", "npmClient": "yarn", "useWorkspaces": true, "useNx": true, "command": { "version": { "message": "build: update version" }, "publish": { "registry": "https://registry.npmjs.org/" } } }

<!-- Please paste your `lerna.json` here -->

Context

Your Environment

Executable Version
lerna --version 5.0.0
npm --version 8.5.5
yarn --version v1.22.18
node --version 16.15.0
OS Version
NAME VERSION

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
JamesHenrycommented, Aug 1, 2022

Great, thanks for confirming @raviteja83! Sorry for the issue

0reactions
raviteja83commented, Aug 1, 2022

Working with 5.3.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Version and Publish - Lerna
Because of that, running lerna publish with a major version zero and choosing any non-prerelease version number will cause new versions to be...
Read more >
@lerna/publish | Yarn - Package Manager
When you run the new command lerna repair , lerna will execute a series of code migrations/codemods which update your workspace to the...
Read more >
Configure Lerna to publish NPM packages to private Gitlab repo
It seems that the .npmrc files in each package are ignored when publishing. I've created a single .npmrc file in the root of...
Read more >
Setting up a monorepo with Lerna for a TypeScript project
Learn how to setup a monorepo with Lerna and configure it for ... lerna info current version 0.0.3 lerna info Looking for changed...
Read more >
lerna/publish/README.md - UNPKG
5, ## Usage. 6. 7, ```sh. 8, lerna publish # publish packages that have changed since the last release. 9, lerna publish from-git...
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