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 ERR! lerna ENOENT: no such file or directory open `package.json`

See original GitHub issue

When attempting to publish through Lerna I’m getting this error after creating a new release version number and after Lerna has pushed tags (lerna run build && lerna publish --contents dist). Lerna is building and publishing each package as it always has for me but this new package is halting the entire process since it can’t find package.json. When I run npm pack on this package the generated files has a package.json so I’m not sure why my Lerna set up isn’t able to access package.json.

This issue is due to my lack of package publishing and I’m hoping to get a better understanding of it while figuring this out.

Generally speaking, when a bundler (webpack, rollup, etc) bundles src files and outputs them into an out directory (.dist/ in my case) does package.json get pulled into those out files as well when executing a build? (using rollup, not sure what magic is really happening)

Your Environment

Using rollup.js to bundle this package.

Executable Version
lerna --version 3.16.4
npm --version 6.12.0
yarn --version 1.7.0
node --version v12.13.0
OS Version
NAME VERSION

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
evocateurcommented, Oct 25, 2019

No, the --contents option is a dirty hack for people who insist they need to recreate the entire package structure in a subdirectory. A traditional dist directory that you point to in your package.json’s main (or module) field absolutely does not require --contents to be employed.

Just omit it entirely, and you’ll be fine. I’ve published literally thousands of versions of hundreds of packages that use transpiled output (with Rollup, Babel, or Webpack) without ever needing to use --contents with lerna publish.

0reactions
github-actions[bot]commented, Jun 17, 2022

Hi Folks 👋

You will have seen in our message above that we at Nrwl are working really hard to bring the lerna repo up to date with what matters most to its community in June 2022.

As previously stated in that message, because we have not heard from the original author of this issue within the last 14 days, we are now automatically closing it.

If any users, including the original author, are still impacted by this issue then we still want to hear from you!

All we ask is that you first update to the latest lerna (5.1.4 at the time of writing) to make sure it is still reproducible, and then fill out one of our new issue templates, providing all the requested details which apply to your situation:

https://github.com/lerna/lerna/issues/new/choose

Many thanks again! 🙏


P.S. Over and above getting to grips with the repo, we have also been hard at work launching a new website, resolving all vulnerabilities, merging exciting new features and reigniting community PR contributions! 🚀

You can read our recent blog post to learn more about what we’ve been up to: https://blog.nrwl.io/lerna-5-1-new-website-new-guides-new-lerna-example-repo-distributed-caching-support-and-speed-64d66410bec7

Read more comments on GitHub >

github_iconTop Results From Across the Web

lerna bootstrap fails with "no such file or directory"
I am doing this on a Docker linux container. My frustration lies in the fact that the same setup worked on my previous...
Read more >
npm WARN enoent ENOENT no such file or directory open ...
I just want to install socket.io to my project which is located on 3.chat folder. But when I run following command it shows...
Read more >
no such file or directory, open \package.json install bootstrap ...
Solved: npm WARN saveError ENOENT : no such file or directory, open \ package. json install bootstrap. 22K views 1 year ago.
Read more >
Error on running npm install on root folder - Development
lerna ERR ! npm install exited 1 in '@joplin/renderer' lerna ERR! npm install stderr: npm WARN tar ENOENT: no such file or directory,...
Read more >
Project Configuration
Both package.json and project.json files are located in each project's folder. ... You can invoke nx build mylib or nx test mylib without...
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