{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-trace-nodejs/issues/545","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-trace-nodejs","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-trace-nodejs/issues/545/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-trace-nodejs/issues/545/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-trace-nodejs/issues/545/events","html_url":"https://github.com/GoogleCloudPlatform/cloud-trace-nodejs/issues/545","id":253354632,"number":545,"title":"Semver throws error while initializing trace agent","user":{"login":"sanderploegsma","id":1564254,"avatar_url":"https://avatars1.githubusercontent.com/u/1564254?v=4","gravatar_id":"","url":"https://api.github.com/users/sanderploegsma","html_url":"https://github.com/sanderploegsma","followers_url":"https://api.github.com/users/sanderploegsma/followers","following_url":"https://api.github.com/users/sanderploegsma/following{/other_user}","gists_url":"https://api.github.com/users/sanderploegsma/gists{/gist_id}","starred_url":"https://api.github.com/users/sanderploegsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanderploegsma/subscriptions","organizations_url":"https://api.github.com/users/sanderploegsma/orgs","repos_url":"https://api.github.com/users/sanderploegsma/repos","events_url":"https://api.github.com/users/sanderploegsma/events{/privacy}","received_events_url":"https://api.github.com/users/sanderploegsma/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-08-28T14:53:01Z","updated_at":"2017-09-07T14:39:33Z","closed_at":"2017-08-29T16:59:07Z","author_association":"NONE","body":"I tried adding the trace agent to an application running Node.js 8.1.4 and got this error thrown on startup. I'm not sure why the `version` field in the package.json would contain the resolved url instead of the version number, but as fair as I traced it correctly it would be fairly easy to avoid throwing by testing if `semver.valid()` on `trace-plugin-loader.js:103:41`\r\n\r\n``` \r\n/app/node_modules/semver/semver.js:293\r\n    throw new TypeError('Invalid Version: ' + version);\r\n    ^\r\n\r\nTypeError: Invalid Version: https://registry.npmjs.org/redis/-/redis-2.7.1.tgz\r\n    at new SemVer (/app/node_modules/semver/semver.js:293:11)\r\n    at Range.test (/app/node_modules/semver/semver.js:1036:15)\r\n    at Function.satisfies (/app/node_modules/semver/semver.js:1085:16)\r\n    at /app/node_modules/@google-cloud/trace-agent/src/trace-plugin-loader.js:103:41\r\n    at Array.forEach (native)\r\n    at loadAndPatch (/app/node_modules/@google-cloud/trace-agent/src/trace-plugin-loader.js:102:16)\r\n    at Function.Module_load [as _load] (/app/node_modules/@google-cloud/trace-agent/src/trace-plugin-loader.js:159:27)\r\n    at Module.require (module.js:513:17)\r\n    at require (internal/module.js:11:18)\r\n    at Object.<anonymous> (/app/src/app.js:4:15)\r\n```"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-trace-nodejs/issues/comments/327820137","html_url":"https://github.com/GoogleCloudPlatform/cloud-trace-nodejs/issues/545#issuecomment-327820137","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-trace-nodejs/issues/545","id":327820137,"user":{"login":"sanderploegsma","id":1564254,"avatar_url":"https://avatars1.githubusercontent.com/u/1564254?v=4","gravatar_id":"","url":"https://api.github.com/users/sanderploegsma","html_url":"https://github.com/sanderploegsma","followers_url":"https://api.github.com/users/sanderploegsma/followers","following_url":"https://api.github.com/users/sanderploegsma/following{/other_user}","gists_url":"https://api.github.com/users/sanderploegsma/gists{/gist_id}","starred_url":"https://api.github.com/users/sanderploegsma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanderploegsma/subscriptions","organizations_url":"https://api.github.com/users/sanderploegsma/orgs","repos_url":"https://api.github.com/users/sanderploegsma/repos","events_url":"https://api.github.com/users/sanderploegsma/events{/privacy}","received_events_url":"https://api.github.com/users/sanderploegsma/received_events","type":"User","site_admin":false},"created_at":"2017-09-07T14:39:33Z","updated_at":"2017-09-07T14:39:33Z","author_association":"NONE","body":"For future reference, I found out this behaviour was triggered by https://github.com/npm/npm/issues/16926. Looks like npm@5.0.x is very much unstable."}}
{"actor":{"display_login":"sanderploegsma"}}