Reactjs 在React测试库上运行初始测试时,fsevents不是函数

Reactjs 在React测试库上运行初始测试时,fsevents不是函数,reactjs,jestjs,react-testing-library,Reactjs,Jestjs,React Testing Library,我是React测试库的新手,遇到以下错误: TypeError:fsevents不是一个函数 at new FSEventsWatcher (/Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/lib/FSEventsWatcher.js:162:20) at createWatcher (/Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/index.js:1

我是React测试库的新手,遇到以下错误:

TypeError:fsevents不是一个函数

at new FSEventsWatcher (/Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/lib/FSEventsWatcher.js:162:20)
at createWatcher (/Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/index.js:1052:23)
at Array.map (<anonymous>)
at HasteMap._watch (/Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/index.js:1230:44)
at /Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/index.js:517:21
at Generator.next (<anonymous>)
at asyncGeneratorStep (/Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/index.js:193:24)
at _next (/Users/abc/Desktop/PostIt/node_modules/jest-haste-map/build/index.js:213:9)
at processTicksAndRejections (internal/process/task_queues.js:93:5) npm ERR! code ELIFECYCLE npm

删除
node\u模块
文件夹和
package lock.json
文件,然后再次执行
npm安装

import React from 'react';
import { render, fireEvent, waitForElement, cleanup } from '@testing-library/react';
import App from './App';
import '@testing-library/jest-dom/extend-expect'
afterEach(cleanup)

test('make sure that I can submit a question', async () => {
  const {debug} = render(
    <App />
  ) 
debug();
})