-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Weird npm ci behavior and unclear documentation #1539
Comments
- also fix: add npm ci --dev deprecation message - Related to #1539 PR-URL: #1575 Credit: @sandratatarevicova Close: #1575 Reviewed-by: @ruyadorno
- also fix: add npm ci --dev deprecation message - Related to #1539 PR-URL: #1575 Credit: @sandratatarevicova Close: #1575 Reviewed-by: @ruyadorno
- also fix: add npm ci --dev deprecation message - Related to #1539 PR-URL: #1575 Credit: @sandratatarevicova Close: #1575 Reviewed-by: @ruyadorno
npm If your bug is preproducible on If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo Closing: This is an automated message. |
What / Why
I have found out that when installing dependencies using
npm ci
onlydevDependencies
are installed whenNODE_ENV=production
environment variable is set [1]. This, unfortunately, is not mentioned innpm ci
documentation, but there is this sentence:So I have checked
npm install
documentation and I found this:Which probably applies for
npm ci
as well and explains the behavior described above. But then I dug a little deeper and found a few weird things.--dev
option [2]Command
NODE_ENV=production npm ci --dev
installs bothdevDependencies
anddependencies
. This option is not mentioned innpm ci
nornpm install
documentation but it seems that it is deprecated, becausenpm install --dev
prints this:But I am not sure if
--only=dev
is the correct replacement for--dev
option, because--only=dev
installs onlydevDependencies
and notdependencies
. It seems that npm supports an--also
option (unfortunately undocumented) which seems to do the same thing as--dev
did, so maybe the message should be:Note 1:
npm ci
does not print the deprecation message when using the--dev
option.Note 2: The
--also=dev
option seems to work fornpm ci
as well.--only=dev
option [3]The option
--only=dev
works correctly withnpm install
, but it does not seem to work withnpm ci
. It always installs 0 dependencies:When
Where
npm ci
andnpm install
How
Current Behavior
npm ci
documentation does not mention its supported options.npm install --dev
deprecation message is maybe wrong.--only=dev
option does not work innpm ci
.Steps to Reproduce
I can create a sample repository and exact steps to reproduce the issues if it is helpful.
Expected Behavior
npm ci
documentation is clearer.npm install --dev
deprecation message suggests an equivalent replacement.npm install
options work fornpm ci
or allnpm ci
options are in its documentation.Who
References
The text was updated successfully, but these errors were encountered: