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

🦋 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
- ci: add action to test https://github.com/changesets/changesets/issues/841 — committed to hcharley/changesets-issue-841 by hcharley 2 years ago
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!!
https://github.com/mahboobmonnamd/monorepo-js check this it may help you