diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index dcbe42d59a4cf..7e74b1fea2cf2 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -727,13 +727,16 @@ module.exports = cls => class Reifier extends cls { // ${REGISTRY} or something. This has to be threaded through the // Shrinkwrap and Node classes carefully, so for now, just treat // the default reg as the magical animal that it has been. - // const resolvedURL = new URL(resolved) - const resolvedURL = hgi.parseUrl(resolved) + let resolvedURL = hgi.parseUrl(resolved) if (!resolvedURL) { - // if we could not parse the url at all then returning nothing - // here means it will get removed from the tree in the next step - return + try { + resolvedURL = new URL(resolved) + } catch { + // if we could not parse the url at all then returning nothing + // here means it will get removed from the tree in the next step + return + } } if ((this.options.replaceRegistryHost === resolvedURL.hostname)