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

pnpm crashes because of bad non-null assertion at newLockfile.packages! #5553

Closed
jedwards1211 opened this issue Oct 25, 2022 · 2 comments · Fixed by #5557
Closed

pnpm crashes because of bad non-null assertion at newLockfile.packages! #5553

jedwards1211 opened this issue Oct 25, 2022 · 2 comments · Fixed by #5557

Comments

@jedwards1211
Copy link

Clearly non-null assertions are an antipattern...

pnpm version: 7.14.0

When I try to install one of my private packages I get a null pointer error on newLockfile.packages here:

if (requiresBuild && newLockfile.packages![depPath]) {

Code to reproduce the issue:

I'm afraid I haven't gotten it down to an easy repro as this only happens when I try to install one of my private packages on an AWS instance so far.

@zkochan
Copy link
Member

zkochan commented Oct 26, 2022

I guess we can easily fix this, but it would be interesting to see in what case it is null. I can't find any scenario when that would happen. Unless someone creates an afterAllResolved hook in .pnpmfile.cjs and removes the field from the lockfile.

@jedwards1211
Copy link
Author

jedwards1211 commented Oct 27, 2022

If it helps, I was trying to sudo pnpm i -g <tarball url> on an AWS EC2 Instance. I tried at one point with a tarball made by npm with bundleDependencies: true, but also one without bundling dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants