Skip to content
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

docs: Remove ", instead of updating the package lock" #7778

Closed
wants to merge 1 commit into from

Conversation

DanKaplanSES
Copy link
Contributor

Remove ", instead of updating the package lock" from the docs because, AFAIK, that never occurs anyway. The last bullet point states this, too.

References

- Removed ", instead of updating the package lock" from the docs because, AFAIK, that never occurs anyway. The last bullet point states this, too.
@DanKaplanSES DanKaplanSES requested a review from a team as a code owner September 12, 2024 00:23
@wraithgar
Copy link
Member

This is referring to the fact that npm install would update the package-lock to match in that case, which npm ci will not do.

@DanKaplanSES
Copy link
Contributor Author

@wraithgar Clarifying question: Are you saying the phrase should remain in the docs?

@wraithgar
Copy link
Member

Yes I think it should.

@DanKaplanSES
Copy link
Contributor Author

Yes I think it should.

I see. I'm not following how would a reader could know that phrase is referring to npm install. If you have the time, could you walk me through that?

@reggi
Copy link
Contributor

reggi commented Sep 13, 2024

@DanKaplanSES a reader would know that phrase is referring to npm install because the file starts off with:

This command is similar to npm install, except...

And lists the differences between the two commands.

@DanKaplanSES
Copy link
Contributor Author

DanKaplanSES commented Sep 13, 2024

Okay, I understand the thought process, but:

If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.

can also be misinterpreted as:

If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of [npm ci] updating the package lock.

One way to prevent that misinterpretation is to remove the phrase entirely, but there are other ways, such as:

If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, whereas npm install would update the package lock file.

I'm not tied to my edit, but IMO, it should be edited in some way because it can be misinterpreted, and there are easy ways to prevent the possibility.

@reggi
Copy link
Contributor

reggi commented Sep 13, 2024

Sorry I posted a message then deleted it. I think this is fine as it is theres also a heading for the list which offers further context for the sentence.

The main differences between using npm install and npm ci are:

@DanKaplanSES
Copy link
Contributor Author

DanKaplanSES commented Sep 13, 2024

Sorry I posted a message then deleted it. I think this is fine as it is theres also a heading for the list which offers further context for the sentence.

The main differences between using npm install and npm ci are:

Hi @reggi I'm not sure I fully understand your point of view yet. Would it be misrepresenting your position if I reworded your statement like this: "This is fine because it can be interpreted correctly"?

@reggi
Copy link
Contributor

reggi commented Sep 16, 2024

@DanKaplanSES I think this is fine because it can be interpreted correctly. This is a page for npm ci command and the list is of differences between these two commands.

The main differences between using npm install and npm ci are:

* The project must have an existing package-lock.json or npm-shrinkwrap.json.
* If dependencies in the package lock do not match those in package.json, npm ci will exit with an error, instead of updating the package lock.
* npm ci can only install entire projects at a time: individual dependencies cannot be added with this command.
* If a node_modules is already present, it will be automatically removed before npm ci begins its install.
* It will never write to package.json or any of the package-locks: installs are essentially frozen.

If I were to have a document about bananas

The main differences between apples and bananas are:

 * bananas are yellow, instead of being red

I don't think it's super ambiguous what "red" is referring to.

I think this is grammatically and colloquially ok to leave it as it is.

@reggi reggi closed this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants