{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/10815","labels_url":"https://api.github.com/repos/npm/npm/issues/10815/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/10815/comments","events_url":"https://api.github.com/repos/npm/npm/issues/10815/events","html_url":"https://github.com/npm/npm/issues/10815","id":122182120,"number":10815,"title":"Value of $npm_package_repository_url in a script different from value in package.json","user":{"login":"ELLIOTTCABLE","id":200,"avatar_url":"https://avatars.githubusercontent.com/u/200?v=3","gravatar_id":"","url":"https://api.github.com/users/ELLIOTTCABLE","html_url":"https://github.com/ELLIOTTCABLE","followers_url":"https://api.github.com/users/ELLIOTTCABLE/followers","following_url":"https://api.github.com/users/ELLIOTTCABLE/following{/other_user}","gists_url":"https://api.github.com/users/ELLIOTTCABLE/gists{/gist_id}","starred_url":"https://api.github.com/users/ELLIOTTCABLE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ELLIOTTCABLE/subscriptions","organizations_url":"https://api.github.com/users/ELLIOTTCABLE/orgs","repos_url":"https://api.github.com/users/ELLIOTTCABLE/repos","events_url":"https://api.github.com/users/ELLIOTTCABLE/events{/privacy}","received_events_url":"https://api.github.com/users/ELLIOTTCABLE/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/package-json","name":"package-json","color":"e1e121"},{"url":"https://api.github.com/repos/npm/npm/labels/support","name":"support","color":"FF91AF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-15T02:59:29Z","updated_at":"2015-12-16T22:23:56Z","closed_at":null,"body":"With this line in the `package.json`,\r\n\r\n    \"repository\" : {\"type\" : \"git\", \"url\" : \"https://github.com/Blah/Widget.git\"}\r\n\r\n`npm run-script` provides the following value as `\"$npm_package_repository_url\"`:\r\n\r\n    git+https://github.com/Blah/Widget.git\r\n\r\nThis fails with commands like `git clone ${npm_package_repository_url }` and similar. As far as I can tell, this is the only property which comes out *differently* in a env-var than it's encoded in the `package.json`; I can't tell if this is intended, but undocumented, functionality; or a strange bug. (What even *is* that syntax?)"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/165272951","html_url":"https://github.com/npm/npm/issues/10815#issuecomment-165272951","issue_url":"https://api.github.com/repos/npm/npm/issues/10815","id":165272951,"user":{"login":"othiym23","id":418097,"avatar_url":"https://avatars.githubusercontent.com/u/418097?v=3","gravatar_id":"","url":"https://api.github.com/users/othiym23","html_url":"https://github.com/othiym23","followers_url":"https://api.github.com/users/othiym23/followers","following_url":"https://api.github.com/users/othiym23/following{/other_user}","gists_url":"https://api.github.com/users/othiym23/gists{/gist_id}","starred_url":"https://api.github.com/users/othiym23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othiym23/subscriptions","organizations_url":"https://api.github.com/users/othiym23/orgs","repos_url":"https://api.github.com/users/othiym23/repos","events_url":"https://api.github.com/users/othiym23/events{/privacy}","received_events_url":"https://api.github.com/users/othiym23/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T22:23:56Z","updated_at":"2015-12-16T22:23:56Z","body":"I agree that this isn't the most sensible or understandable format for use outside the CLI, but if you take a look at what [`lib/utils/lifecycle.js` is doing](https://github.com/npm/npm/blob/master/lib/utils/lifecycle.js#L269-L366), it's pretty a simple-minded of what's in the configuration and the package into the child environment. I have no objection to making changes to that data to make it more ergonomic for people writing package scripts, although I'd prefer it to be done in a systematic way (`\"repository\"` is far from the only piece of information to be transformed like this – `npm run env` will allow you to see at once how much data there is, and how it gets transformed).\r\n\r\nThe tricky part is that would need to happen in `lifecycle.js` itself, because otherwise it could break npm. This is why it's relevant that this dump is based on the internal representation used by the CLI itself. I also have concerns that there are people out there depending on the current representation, so changes here should be considered semver-major (which is fine – I anticipate another semver-major release, just for these kinds of changes, sometime in February or March of 2016). The CLI team itself is probably not going to have any cycles to get to this for the foreseeable future, though."}}