Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

npm version should work in a git directory w/o git - #6528

Merged
othiym23 merged 1 commit into
masterfrom
version-handle-enogit
Oct 21, 2014
Merged

othiym23 merged 1 commit into
masterfrom
version-handle-enogit

Conversation

@terinjokes

Copy link
Copy Markdown
Contributor

If a package seemed to be located in a git directory (for example, if it
was alongside a ".git" directory), but the user did not have git on
their path, npm would throw a cryptic error about calling trim on
undefined.

With this patch, npm will log that git was not found, and that tagging
the version was skipped, but otherwise go on to updating the
package.json file.

This was probably primarily felt by Windows users, where git might be
located within a GUI client, but would be using npm from the command
prompt.

If a package seemed to be located in a git directory (for example, if it
was alongside a ".git" directory), but the user did not have git on
their path, npm would throw a cryptic error about calling trim on
undefined.

With this patch, npm will log that git was not found, and that tagging
the version was skipped, but otherwise go on to updating the
package.json file.

This was probably primarily felt by Windows users, where git might be
located within a GUI client, but would be using npm from the command
prompt.
@othiym23
othiym23 force-pushed the version-handle-enogit branch from 777277d to 80b368f Compare October 21, 2014 04:42
@othiym23
othiym23 merged commit 80b368f into master Oct 21, 2014
@othiym23 othiym23 added this to the 2.1.6 milestone Oct 21, 2014
@othiym23
othiym23 deleted the version-handle-enogit branch October 21, 2014 04:48
@othiym23

Copy link
Copy Markdown
Contributor

Thank you, @terinjokes! Also thank you for including a test!

@coveralls

Copy link
Copy Markdown

Coverage Status

Changes Unknown when pulling 80b368f on version-handle-enogit into * on master*.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants