Graphql-code-generator: --watch throws "Watchman: Watchman was not found in PATH error."

Created on 3 Dec 2018  路  1Comment  路  Source: dotansimha/graphql-code-generator

Describe the bug
--watch does not seem to work without Watchman installed on your OS.

Watchman:  Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions
(node:11884) UnhandledPromiseRejectionWarning: Error: Watchman was not found in PATH.  See https://facebook.github.io/watchman/docs/install.html for installation instructions
    at Process.ChildProcess._handle.onexit (internal/child_process.js:230:19)
    at onErrorNT (internal/child_process.js:407:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
(node:11884) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11884) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

To Reproduce

  1. Don't have Watchman installed on your OS.
  2. Run the following command: gql-gen --watch

Expected behavior
gql-gen --watch generates code and watches for changes out of the box.

Environment:

  • OS: Ubuntu 18.04
  • Codegen: 0.14.5
  • Node: 10.8.0

Additional context
We use graphql-code-generator as a dev-dependency and I find it strange that a npm dependency relies on an OS dependency. Is this expected behavior? Currently I work around it by using nodemon because I don't like to introduce additional installation requirements besides npm i.

bug core

Most helpful comment

We switched to chokidar in v0.15.0

>All comments

We switched to chokidar in v0.15.0

Was this page helpful?
0 / 5 - 0 ratings