Currently, if your .npmrc is missing the registry key, you'll get an error about not being able to find .npmrc
I didn't realize that the npmrc I am using doesn't specify registry=foo, it was working with just having auth setup without registry itself
The Fix
This PR alters the error messages emitted to be more specific. We will first check if the npmrc exists that we are about to load, and emit an error if it doesn't. Then we will catch the error that is thrown by Config.load when registry is missing/invalid and emit a specific error message.
This way you won't see a "Missing npmrc" error if you just happen to have an invalid or missing registry
The Problem
Currently, if your .npmrc is missing the registry key, you'll get an error about not being able to find .npmrc
I didn't realize that the npmrc I am using doesn't specify
registry=foo
, it was working with just having auth setup without registry itselfThe Fix
This PR alters the error messages emitted to be more specific. We will first check if the npmrc exists that we are about to load, and emit an error if it doesn't. Then we will catch the error that is thrown by
Config.load
when registry is missing/invalid and emit a specific error message.This way you won't see a "Missing npmrc" error if you just happen to have an invalid or missing registry