changesets: TypeError: Cannot read property 'packageJson' of undefined

Affected Packages

{
  "devDependencies": {
    "@changesets/cli": "^2.23.0",
    "typescript": "4.7.3"
  }
}

node v14.19.3 pnpm v7.2.1 pc Apple M1 Pro

Problem

image
🦋  error TypeError: Cannot read property 'packageJson' of undefined
🦋  error     at createChangeset (/Users/fupeng/Workspace/github/silly-girl/node_modules/.pnpm/@changesets+cli@2.23.0/node_modules/@changesets/cli/dist/cli.cjs.dev.js:415:75)
🦋  error     at add (/Users/fupeng/Workspace/github/silly-girl/node_modules/.pnpm/@changesets+cli@2.23.0/node_modules/@changesets/cli/dist/cli.cjs.dev.js:507:26)
🦋  error     at processTicksAndRejections (internal/process/task_queues.js:95:5)
🦋  error     at async run$2 (/Users/fupeng/Workspace/github/silly-girl/node_modules/.pnpm/@changesets+cli@2.23.0/node_modules/@changesets/cli/dist/cli.cjs.dev.js:1254:5)

Proposed solution

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 4
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

in my root package.json has this config : “workspaces”: [ “packages/” ]; when i run " npx changeset", there has err “TypeError: Cannot read properties of undefined (reading ‘packageJson’);”

so, i try to change “workspaces”: [ “packages/” ] => “workspaces”: [ “packages/*” ] or delete this config, the are working!!