-
Notifications
You must be signed in to change notification settings - Fork 3k
Added support for install --development #4791
Conversation
This seems very niche, and adding a --development flag that is different from the --dev flag seems bad. So, I am -1... |
Well, I went with I talked to @isaacs about this today and he mentioned that he would possibly rather just fix |
Ping @isaacs, would you rather do this or have me fix |
We should definitely not have Why doesn't this work? rm -rf node_modules # start fresh
npm install --production --registry=https://npm.yahoo.com/
# analyze etc
npm install # grab missing dev deps
npm test
npm prune --production |
The issue here is my whitelist, if a production dep is not in the whitelist it will 404 on the first install. When the second install happens it will install anyway, then What if we added a |
This sounds nice to me although I have not thought out how it composes with other uses of --depth etc. throughout the CLI. |
I tried simply adding a The other issue with that, is adding |
I'm +1 on this, and part of the reason I like it is because it allows us to continue deprecating the giant footgun that is |
Needs to run top-level lifecycle scripts as well. |
This needs to happen soonish for @davglass-related reasons. |
How about (Yeah it duplicates |
This basically installs the packages that
npm prune --production
would remove.Use case:
In a CI environment, I need to:
Now, I could do a
--production
install, then install without but I actually want to "switch" registries in between these. I only want "production" dependencies installed from a private local registry, but devDependencies can come from anywhere as they will be deleted with a prune. If a production dependency isn't in my local registry, it should 404 but doing a two pass install without scoping it would let it install anyway and thenprune
wouldn't work as I would expect.I couldn't get all the tests to run on any of my dev machines from master or this branch, but I did add 7 passing tests for this functionality: