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

[BUG] Cannot convert undefined or null to object #79

Closed
1 task done
PapiOphidian opened this issue Dec 27, 2022 · 0 comments · Fixed by #91
Closed
1 task done

[BUG] Cannot convert undefined or null to object #79

PapiOphidian opened this issue Dec 27, 2022 · 0 comments · Fixed by #91

Comments

@PapiOphidian
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When attempting to install a package that doesn't exist, then an Error at https://github.com/npm/npm-pick-manifest/blob/main/lib/index.js#L213 throws an exception where it cannot convert undefined or null to an object, causing the actual npm install error to be hidden away. I was able to figure out what the error actually was by modifying the source, but I'm guessing this is a deeper level issue than just slapping in a || {} and calling it a day.

Expected Behavior

The error saying the package or version doesn't exist to properly throw rather than an internal error

Steps To Reproduce

  1. run npm install this-package-does-not-exist-at-all (or any other package that doesn't exist. For me, it was validate-any@1.3.2)

Environment

  • npm: 9.2.0
  • Node: 18.6.0
  • OS: Windows 11
  • platform: custom build pc (x86)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant