Skip to content
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

[Error] - Cannot convert undefined or null to object (auto-install-peers=true) #4804

Closed
raulfdm opened this issue May 26, 2022 · 3 comments
Closed

Comments

@raulfdm
Copy link

raulfdm commented May 26, 2022

pnpm version: 7.1.5

Code to reproduce the issue:

  1. Clone this repo: https://github.com/raulfdm/raulmelo-studio
  2. Checkout to the branch cannot-convert-undefined-or-null-to-object
  3. Run pnpm i
  4. See the error Cannot convert undefined or null to object

You can also try remove pnpm.lock.yaml and run pnpm i again. The error will still remain.

I think this is, somehow, related to auto-install-peers=true present in the .npmrc because if I:

  1. set auto-install-peers to false;
  2. run pnpm i (it'll run successfuly) and throw errors due missing peerDeps;
  3. set auto-install-peers to true;
  4. runpnpm i --force (no missing peerDeps error)

I won't get Cannot convert undefined or null to object.

Expected behavior:

Either install deps and regen lock file or give me a good error message so I have a clue what's wrong and fix the issue.

Actual behavior:

Blocks the installation.

Additional information:

  • node -v prints: v16.14.2
  • Windows, macOS, or Linux?: macOS Monterey 12.4 - Apple M1 PRO
@raulfdm
Copy link
Author

raulfdm commented May 26, 2022

I had done the workaround in my main branch and thought it was about working but I notice the the error come back if I run pnpm i --lockfile-only:

➜  raulmelo-studio git:(main) ✗ pnpm i
Scope: all 8 workspace projects
Lockfile is up-to-date, resolution step is skipped
Already up-to-date
apps/fitness-buddy postinstall$ pnpm run typegen
│ > fitness-buddy@0.0.1 typegen /Users/raulmelo/development/raulmelo-studio/apps/fitness-buddy
│ > xstate typegen "src/**/*.ts?(x)"
│ src/lib/stores/trainingMachine.ts - success
└─ Done in 713ms
apps/fitness-buddy prepare$ svelte-kit sync
└─ Done in 191ms
➜  raulmelo-studio git:(main) ✗ pnpm i --lockfile-only
Scope: all 8 workspace projects
 WARN  `node_modules` is present. Lockfile only installation will make it out-of-date
 ERROR  Cannot convert undefined or null to object
Progress: resolved 0, reused 1, downloaded 0, added 0

@zkochan
Copy link
Member

zkochan commented May 27, 2022

It is a duplicate of #4796

@zkochan zkochan closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2022
@tanBeehexa
Copy link

tanBeehexa commented Oct 12, 2022

I fix it by reinstall/updating lockfile

@pnpm pnpm locked as resolved and limited conversation to collaborators Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants