Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

npm error: --watch is not supported without git/hg, please use --watchAll #282

Closed
@emoriarty

Description

@emoriarty

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes.

Environment

  1. npm ls react-scripts-ts: [email protected]
  2. node -v: v9.7.0
  3. npm -v: 5.7.1
  4. os: macOS 10.13.1

Steps to Reproduce

  1. Install new project as described in README: create-react-app my-app --scripts-version=react-scripts-ts.
  2. Execute npm run test
  3. After cleaning the terminal screen as expected an npm task error is shown and no test is being carried out. Below is shown the issue message.
Determining test suites to run...
--watch is not supported without git/hg, please use --watchAll
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `react-scripts-ts test --env=jsdom`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Expected Behavior

No error happen and tests are executed.

Actual Behavior

When running the command described above, the test script is having the mentioned error. This error happens only under a npm context. When running the script directly on terminal only the warning message is shown but still no test is executed.

$ ./node_modules/.bin/react-scripts-ts test --env=jsdom

Determining test suites to run...
--watch is not supported without git/hg, please use --watchAll

This same issue is not happening in base project react-scripts.

After struggling a bit why it is happening I've come across test.js file where is being carried the testing operation. I've just replaced --watch by --watchAll as indicated in the message returned. The next execution was successful.

Intrigued if this change has being done in react-scripts project, I've found the test.js file differs from the current project from line 24. The interesting part is where this option is attached. It is still passing the same --watch and not the --watchAll as the message warns.

So, I don't know if this change I'm pointing out must be the proper fix.

Please have a look when you have time. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions