question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React-scripts test command not working

See original GitHub issue

Describe the bug

react-scripts test command stopped working after update to ^4.0.3 from ^3.0.0.

It shows this error on terminal:

● Validation Error:

  Watch plugin jest-watch-typeahead/filename cannot be found. Make sure the watchPlugins configuration option points to an existing node module.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

error Command failed with exit code 1.

Nothing has changed on the code. Only react-scripts package. Tests were working fine before the update. The project is not ejected and it is not intended to be.

Did you try recovering your dependencies?

Yes, I tried. yarn version: 1.22.10

Which terms did you search for in User Guide?

I’ve search for ‘react-scripts test’ and ‘watchPlugins’ and all I found is that I need to eject the project. I don’t understand why. It was never like that. So I think that is not the solution to the problem.

Steps to reproduce

  1. Open a terminal on the CRA project root
  2. Run yarn
  3. Run yarn test

Expected behavior

I expect tests run fine. Like before updating to ^4.0.3.

Actual behavior

react-scripts test command stops working after update react-scripts library to ^4.0.3 from ^3.0.0.

It shows this error on terminal:

● Validation Error:

  Watch plugin jest-watch-typeahead/filename cannot be found. Make sure the watchPlugins configuration option points to an existing node module.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

error Command failed with exit code 1.

Thank you 😄

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:22
  • Comments:19

github_iconTop GitHub Comments

50reactions
ggwzrdcommented, Oct 13, 2021

I have had the same issue and one important thing to notice is that the newest released version of jest-watch-typeahead is now written in native ESM and will break with the following error:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module

Make sure to install the version compatible with Jest 26 e non native ESM modules.

yarn add --exact jest-watch-typeahead@0.6.5
5reactions
stale[bot]commented, Jan 9, 2022

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-scripts: command not found
I have installed create-react-app and then when I change into the directory and hit npm start I get a react-scripts: command not found...
Read more >
Fix: React Scripts Command not Found Error - αlphαrithms
Fix 1: Run npm install. In the case where an app might have been cloned, the node_modules directory would not have been copied....
Read more >
react-scripts: command not found error [Solved]
Run the npm install react-scripts command to solve the "react-scripts: command not found" error. If necessary delete your node_modules directory and your ...
Read more >
Fix: React Scripts Command not Found Error | by Zack West
Fix: React Scripts Command not Found Error · Quick Intro: React Apps Setup 101 · The Problem: Running a React-Scripts Command · Fix...
Read more >
How to fix the react-scripts command not found Error
How to fix the react-scripts command not found Error · First, delete the node_modules folder in your project (if you have one) using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found