{"action":"opened","issue":{"url":"https://api.github.com/repos/npm/hosted-git-info/issues/37","repository_url":"https://api.github.com/repos/npm/hosted-git-info","labels_url":"https://api.github.com/repos/npm/hosted-git-info/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/npm/hosted-git-info/issues/37/comments","events_url":"https://api.github.com/repos/npm/hosted-git-info/issues/37/events","html_url":"https://github.com/npm/hosted-git-info/issues/37","id":339103656,"node_id":"MDU6SXNzdWUzMzkxMDM2NTY=","number":37,"title":"`parsed.host.replace` throws NPE when called without a valid URL","user":{"login":"trxcllnt","id":178183,"node_id":"MDQ6VXNlcjE3ODE4Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/178183?v=4","gravatar_id":"","url":"https://api.github.com/users/trxcllnt","html_url":"https://github.com/trxcllnt","followers_url":"https://api.github.com/users/trxcllnt/followers","following_url":"https://api.github.com/users/trxcllnt/following{/other_user}","gists_url":"https://api.github.com/users/trxcllnt/gists{/gist_id}","starred_url":"https://api.github.com/users/trxcllnt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trxcllnt/subscriptions","organizations_url":"https://api.github.com/users/trxcllnt/orgs","repos_url":"https://api.github.com/users/trxcllnt/repos","events_url":"https://api.github.com/users/trxcllnt/events{/privacy}","received_events_url":"https://api.github.com/users/trxcllnt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-07T00:41:13Z","updated_at":"2018-07-07T00:41:13Z","closed_at":null,"author_association":"NONE","body":"We use `npm-run-all` to execute multiple npm scripts. It looks like `npm-run-all` uses the [`normalize-package-data`](https://www.npmjs.com/package/normalize-package-data) library to read `package.json` files.\r\n\r\nThat library (which has a `^2.1.4` dependency on `hosted-git-info`) [calls `hostedGitInfo.fromUrl()`](https://github.com/npm/normalize-package-data/blob/master/lib/fixer.js#L150) with the version of each dev and prod dependency version.\r\n\r\nWith the v2.7.0 release, passing `fromUrl` a semver string now throws an error on [line 61 at the `parsed.host.replace` callsite](https://github.com/npm/hosted-git-info/blame/b7b18a925481d70f6f40a3389446102f19c2db09/index.js#L61), presumably because a semver string doesn't parse to a valid URL, which is reasonable.\r\n\r\nHowever the unfortunate consequences are that using `npm-run-all` from a fresh npm-install yields:\r\n```sh\r\n$ npm run build\r\n\r\n> @my-project@1.0.0 build /home/me/dev/my-project\r\n> run-s clean compile\r\n\r\nERROR: Cannot read property 'replace' of null\r\n```\r\n\r\n:<"}}
{"actor":{"display_login":"trxcllnt"}}