Skip to content

Commit b1aeeb6

Browse files
clabe45Michael Perrotte
authored andcommitted
docs: mention --no-optional in package-json
PR-URL: #705 Credit: @clabe45 Close: #705 Reviewed-by: @mikemimik
1 parent 88cfb88 commit b1aeeb6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

docs/content/configuring-npm/package-json.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,8 @@ If a dependency can be used, but you would like npm to proceed if it cannot be
740740
found or fails to install, then you may put it in the `optionalDependencies`
741741
object. This is a map of package name to version or url, just like the
742742
`dependencies` object. The difference is that build failures do not cause
743-
installation to fail.
743+
installation to fail. Running `npm install --no-optional` will prevent these
744+
dependencies from being installed.
744745

745746
It is still your program's responsibility to handle the lack of the
746747
dependency. For example, something like this:

0 commit comments

Comments
 (0)