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

fix: check npm.config before accessing its members #508

Closed
wants to merge 1 commit into from
Closed

fix: check npm.config before accessing its members #508

wants to merge 1 commit into from

Commits on Nov 20, 2019

  1. fix: check npm.config before accessing its members

    Sometimes, `npm.config` can be missing entirely, but there are several
    places where `npm.config.foo` is accessed blindly, resulting in these
    kinds of errors and stack traces:
    
    TypeError: Cannot read property 'get' of undefined
        at errorMessage (.../lib/utils/error-message.js:38:39)
        ...
    
    TypeError: Cannot read property 'loaded' of undefined
        at exit (.../lib/utils/error-handler.js:97:27)
        ...
    
    LBYL by checking `npm.config` first. Addresses a small part of #502.
    kaiyoma committed Nov 20, 2019
    Copy the full SHA
    32392d9 View commit details
    Browse the repository at this point in the history