fsevents is installed by default with
npm on Mac OS and Windows operating systems. The error
"is not a constructor" might mean you tried to initialize
fsevents in your code. Most likely with the
new keyword. Please review your code for this, if not let me know.
what you have to do is very simple. Run the following
rm -rf node_modules/ package-lock.json
This worked for me.
I had the same issue after a fresh install of node and create-react-app. After some searching I found this article  about a known issue with running npm test.
After installing watchman, tests are running.
Any time I did create-react-app, I got this exact error when I immediately ran 'npm test'. This worked for me if I already was committed to the React project:
npm install email@example.com
After some digging, I found out that I needed to manually install this package because CRA pumped out several
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: firstname.lastname@example.org ...
messages during the initial install. And yet, I needed this package to run 'npm test'.
However, my bigger issue was that CRA was skipping this dependency install because it wasn't detecting xcode on my system. I was getting these messages:
gyp: No Xcode or CLT version detected!
The solution is to run the command
Now, any future create-react-app's should operate smoothly without needing any additional dependency installs! Additional Xcode troubleshooting here.
Had similar issue on OSX. If you have
Homebrew, just run following command in terminal and try again:
brew install watchman
If it doesn't help, try running following commands in terminal:
sudo rm -rf (xcode-select -print-path) xcode-select --install
- ReactJS Test - fsevents is not a function
- How to test a ReactJS function which uses hooks and does not return JSX
- Reactjs test sinon spy mocked function returns a function and not a boolean
- Jest test fails : TypeError: window.matchMedia is not a function
- ReactJs CreateClass is not a function
- TypeError: Object(...) is not a function reactjs
- ReactJS with ES6: this.props is not a function when I communicate two components
- ReactJS giving inst.render is not a function error
- ReactJS toLowerCase is not a function
- ReactJS Array.push function not working in setState
- Reactjs this.setState is not a function error
- In Jest test it says withRouter () is not a function
- calling setState on a reactjs component with test utils not re-rendering component
- this.setState is not a function ( trying Upload Image) ReactJs
- why I can not use function keyword to define a function inside a reactjs class
- Capybara, Poltergeist and Reactjs - 'undefined' is not a function
- Reactjs URL.createObjectURL is not a function
- reactjs TypeError: Object(...) is not a function when using hooks
- TypeError: environment.dispose is not a function when running npm test
- Uncaught TypeError: this.props.onDelete is not a function reactjs
- ReactJS & MobX: TypeError: ... is not a function - but it is?
- Function call inside useEffect not firing in jest test
- ReactJS [issue on production] - TypeError: (void 0) is not a function
- JEST Test suite failed to run: TypeError: (0 , _reactRedux.connect) is not a function
- instance.render is not a function error in reactjs
- TypeError: u.indexOf is not a function for Reactjs and Firebase
- ReactJS Unit Testing - TypeError: this.props.onChange is not a function
- Jest test (ReferenceError: google is not defined) ReactJS and Google Charts
- onClick event not passing a function when placed in a forEach loop in ReactJS
- ReactJS Uncaught ReferenceError function is not defined
More Query from same tag
- Extracting parts into components error: Unexpected token, expected "..."
- Combine 2 objects and maintain order
- How to get textContent from ReactElement?
- Asp.Net Core API CORS policy error (+308 status code)
- Is there a good way to implement a div cross which expands onHover?
- How to use the updated value in redux store immediately after the action is dispatched in react js functional components
- Getting Expected an assignment or function call and instead saw an expression no-unused-expressions, when import a file in React
- How to display dynamic events in react-big-calendar?
- Antd Table not re-rendering
- React router: component not rendering after login
- Why does the selector inside useSelector run twice?
- How to avoid using setState in shouldComponentUpdate() in React?
- ReactJS: show modal with loading message during superagent ajax request
- In the following example of React ES6, how is it possible for an object property referenced w/o the 'this.state'?
- The state in class constructor isn't defined when calling function after render
- how to I get a user's IP address when separate client and server apps, in Node with Nest.js
- SVG image size in React
- Serving static files with express for non-root paths
- Is it possible to set the Analytics ID in gatsby-node.js?
- How to execute a function after a group components did mount in reactjs?
- Settimeout in next js/react
- How to Use Helper Function that Calls an API to Work Inside of UseEffect Hook
- How to save build files (React) using Github Actions
- Module not found: Error: Cannot resolve module 'routes'
- Is there a work-around for the Chrome error: "Require user gesture for beforeunload dialogs" during Cypress tests
- Material UI - React - Place Grid items in a column
- What is the type of a styled-component's argument(s)?
- net::ERR_CONNECTION_REFUSED to cube.dv
- Expand elipsis text of single mapped item