lerna: Lerna error: `package.json` does not exist, have you run `lerna init`?

I run lerna bootstrap

Current Behavior

> lerna bootstrap
lerna notice cli v3.8.0
lerna ERR! ENOPKG `package.json` does not exist, have you run `lerna init`?

Expected Behavior

Should work

Specs

lerna.json

{
  "version": "0.0.5-alpha.0",
  "packages": ["packages/*"],
  "npmClient": "yarn",
  "useWorkspaces": true
}

package.json

{
  "private": true,
  "workspaces": [
    "packages/*",
    "examples/*"
  ],
  "devDependencies": {
      "lerna": "^3.8.0"
  }
}

Executable Version
lerna --version 3.8.0
npm --version 6.5.0
yarn --version 1.13.0
node --version v11.4.0
OS Version
Windows 10 x64 1703

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (3 by maintainers)

Commits related to this issue

Most upvoted comments

It’s work if i add field name to package.json with value root

We should definitely improve the error message in this case, I agree.

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:

// lerna.json
{
  "packages": [
    "packages/*"
  ],
  "version": "independent",
  "npmClient": "yarn",
  "useWorkspaces": true
}