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

Body can be null #6

Closed
koenhoeijmakers opened this issue May 29, 2019 · 6 comments
Closed

Body can be null #6

koenhoeijmakers opened this issue May 29, 2019 · 6 comments

Comments

@koenhoeijmakers
Copy link

We're getting an error in our pipeline that references to the following:

npm timing stage:rollbackFailedOptional Completed in 1ms
npm timing stage:runTopLevelLifecycles Completed in 4666ms
npm verb stack TypeError: Cannot read property 'toString' of null
npm verb stack     at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:98:66

Which is body.toString('utf-8'), i see that there's another body.toString('utf-8') higher up that is being try catched, shouldn't that also happen here?

@blackstar257
Copy link

Just ran into this as well.

@koenhoeijmakers
Copy link
Author

I did find out why it was throwing this error for me.

It was due to NPM trying to load a package that was in a private repo (fontawesome pro) and because i forgot to set the token in my config it resulted in the body being null (and thus throwing this error).

But i'm pretty certain that it should not throw this TypeError.

@blackstar257
Copy link

Same here it ended up being my token for fontawesome got regenerated causing it to 401. i was able to view the error verbosely by running ncu

@blackstar257
Copy link

The error message though wasn't helpful though so i think this issue is still valid but maybe renamed to something like update error handling message when request isn't what is expected

paulfalgout added a commit to paulfalgout/npm-registry-fetch that referenced this issue Sep 10, 2019
@isaacs
Copy link
Contributor

isaacs commented Oct 4, 2019

Closed by #9

@isaacs isaacs closed this as completed Oct 4, 2019
@yaronlevi
Copy link

This thread got me out of dead-end trying to figure out why a Bitrise build is failing.
It was a private NPM repo that was not accessible due to the expiry of an auth token.
Saved me many days 🙏🏼

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

No branches or pull requests

4 participants