-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lerna error: package.json
does not exist, have you run lerna init
?
#1835
Comments
package.json
does not exist`package.json
does not exist, have you run lerna init
?
package.json
does not exist, have you run lerna init
?package.json
does not exist, have you run lerna init
?
It's work if i add field |
It's strange behavior, because lerna in some projects works without field |
You're using Yarn workspaces, why bother with |
@evocateur I just started recently using |
We should definitely improve the error message in this case, I agree. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Up! |
I confirm that the solution mentioned by @artemirq works: adding a And indeed, this error happens sometimes 😕 @evocateur do you foresee any fix for this problem? |
This reverts commit 0318a77.
* yarn upgrade to fix security issue * fix lerna issue lerna/lerna#1835 * Revert "fix lerna issue lerna/lerna#1835" This reverts commit 0318a77. * trying to fix the package.json doesn't exist issue in CI
Same error when version field is missing in lerna.json |
I've just started seeing this issue after upgrading a Yarn 2 project that's been working fine with Lerna to v4, but we already have the config options mentioned above as causing trouble if they're absent:
|
@jalovatt Why you needed Lerna? Yarn contain most of functionality for working with workspaces. |
That's what we ended up doing. Our biggest use for Lerna was the versioning tool, but |
I think I find the exception reason. That will happen when you clone a repo and you specific invalid target folder name. You can set valid name in package.json file to avoid this issue. See code here |
@Rhuaer Yes, you are right. If the directory (folder) name is not a valid name as defined here, and How to reproduce:
At this point, open package.json and remove the
Note that if the directory name is valid, then So it seems to me that
I think it would be super helpful if I ran into this problem when I was making a patch for docusaurus, I made a branch for the commit and used a worktree directory named |
Hi Folks 👋 Please take a look at our published roadmap for Lerna v7 here: #3410 One of the key items covered at length on there (please do read it for full context) is that now that we find ourselves in late 2022, it no longer makes sense for lerna to supplement package management concerns (such as installation, boostrapping, linking etc) which are covered reliably for monorepo workspaces by the three main package managers: npm, yarn and pnpm. If you have any specific concerns please do join in on that discussion, and provide as much context as possible. Many thanks 🙏 |
I run
lerna bootstrap
Current Behavior
Expected Behavior
Should work
Specs
lerna.json
package.json
lerna --version
npm --version
yarn --version
node --version
The text was updated successfully, but these errors were encountered: