{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/9024","labels_url":"https://api.github.com/repos/npm/npm/issues/9024/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/9024/comments","events_url":"https://api.github.com/repos/npm/npm/issues/9024/events","html_url":"https://github.com/npm/npm/pull/9024","id":96444564,"number":9024,"title":"install: Add support for --development, installing devDependencies only","user":{"login":"bengl","id":110455,"avatar_url":"https://avatars.githubusercontent.com/u/110455?v=3","gravatar_id":"","url":"https://api.github.com/users/bengl","html_url":"https://github.com/bengl","followers_url":"https://api.github.com/users/bengl/followers","following_url":"https://api.github.com/users/bengl/following{/other_user}","gists_url":"https://api.github.com/users/bengl/gists{/gist_id}","starred_url":"https://api.github.com/users/bengl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bengl/subscriptions","organizations_url":"https://api.github.com/users/bengl/orgs","repos_url":"https://api.github.com/users/bengl/repos","events_url":"https://api.github.com/users/bengl/events{/privacy}","received_events_url":"https://api.github.com/users/bengl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-22T00:15:21Z","updated_at":"2015-07-23T01:14:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/npm/npm/pulls/9024","html_url":"https://github.com/npm/npm/pull/9024","diff_url":"https://github.com/npm/npm/pull/9024.diff","patch_url":"https://github.com/npm/npm/pull/9024.patch"},"body":"This is a re-do of #4791 for `v3.x`.\r\n\r\nThe intention here is to have a CLI flag that complements `--production`. We have several use cases for this, including switching between registries for both sets of dependencies. A test similar to the one for `--production` is included.\r\n\r\nThe discussion on #4791 seemed to be all about the naming of the flag, so here are some alternatives, in case `--development` isn't acceptable:\r\n\r\n* `--not-production`\r\n* `--only=[production,development]`"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/123924377","html_url":"https://github.com/npm/npm/pull/9024#issuecomment-123924377","issue_url":"https://api.github.com/repos/npm/npm/issues/9024","id":123924377,"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-07-23T01:14:54Z","updated_at":"2015-07-23T01:14:54Z","body":"> 1. In cases where `--dev` currently behaves in ways **other than** how it does in `install` (e.g. shrinkwrap, ls, etc.), should `--dev` also be deprecated in favor of `--development`, using the existing behavior?\r\n\r\n`--dev` and `--development` are synonyms, so we're not trying to deprecate one in favor of the other. The deprecation is of `npm install --dev` / `npm install --development`'s current unhelpful behavior. The deprecation cycle doesn't have to be super long-lived, but the current behavior is working as intended _(but why?)_.\r\n\r\n> 2. Is there an agreement on `--only`?\r\n\r\nI like @iarna's case for using a switch that's less overloaded, so yes, let's call that a consensus. That also has the nice side effect of decoupling the deprecation of `--dev` / `--development` from shipping this feature, because `npm install --only=dev` / `npm install --only=production` isn't a backwards-incompatible change.\r\n\r\nThat said, I agree with @iarna that it would be really good to see the changes to `--development` and `--production` flow out into the other commands where they're used right now. We can keep talking about whether we want to reuse the existing switches or move to using `--only` in those contexts -- shipping just the `npm install` bits seems like the appropriate level of work to start, and lets you get the piece you really need for your day job sooner.\r\n\r\n* `install --production` operates as before, while `install --only=production` doesn't set `NODE_ENV` or other side-effects.\r\n\r\nThis sounds good, but I think maybe deprecating `--production` in favor of `--only=production` in most contexts is a good idea.\r\n\r\n> * Add deprecation warning for `--dev` in all uses, preferring the use of `--only=development` instead, which would have the following behaviors:\r\n>  * For `install`, use new logic as per this PR.\r\n>  * For all other commands, operate as `--dev` did before.\r\n\r\nWith the caveat that preserving `dev` and `development` as interchangeable synonyms is a good thing from an ergonomics point of view, this all sounds good.\r\n\r\n> * Documents!\r\n\r\nYes, please!\r\n\r\nThanks for picking this up, @bengl!"}}