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.

TypeError: Cannot read property 'packageJson' of undefined

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
ijisencommented, Aug 9, 2022

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!!

1reaction
mahboobmonnamdcommented, Jul 13, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Encountered `Cannot read property <package version> of ...
When npmjs.com gives a package.json file that lacks either the dist-tags field or the versions field corresponding to the requested version ( ...
Read more >
TypeError: Cannot read properties of undefined (reading 'config')
I had this code already working with my previous app with dotenv version 10 but when I copied it in my new app...
Read more >
Cannot read property .match of undefined - Heroku Help
Running an npm command, such as npm install or npm ci , may raise something like this: npm err TypeError: Cannot read property...
Read more >
TypeError: Cannot read property 'setup' of undefined (line:289)
Hi everybody, I have been playing with uibuilder and really enjoying it. Developing it locally, everything has went smoothly but I have been...
Read more >
TypeError Cannot read property confvar of undefined - Edureka
conf = require('./conf'); url = conf.config.confvar;. But it gives me an error. TypeError: Cannot read property 'confvar' of undefined.
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