启动开发服务器..。
/Users/puneetrangrass/Documents/react/react-practice/node_modules/chokidar/lib/fsevents-handler.js:28
return (new fsevents(path)).on('fsevent', callback).start();
^
TypeError: fsevents is not a constructor
at createFSEventsInstance (/Users/puneetrangrass/Documents/react/react-practice/node_modules/chokidar/lib/fsevents-handler.js:28:11)
at setFSEventsListener (/Users/puneetrangrass/Documents/react/react-practice/node_modules/chokidar/lib/fsevents-handler.js:82:16)
at FSWatcher.FsEventsHandler._watchWithFsEvents (/Users/puneetrangrass/Documents/react/react-practice/node_modules/chokidar/lib/fsevents-handler.js:252:16)
at FSWatcher. (/Users/puneetrangrass/Documents/react/react-practice/node_modules/chokidar/lib/fsevents-handler.js:386:25)
at LOOP (fs.js:1570:14)
at process._tickCallback (internal/process/next_tick.js:61:11)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-practice@0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-practice@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/puneetrangrass/.npm/_logs/2019-07-13T05_06_50_503Z-debug.log
puneets-MacBook-Pro:react-practice puneetrangrass$ node --v
node: bad option: --v
puneets-MacBook-Pro:react-practice puneetrangrass$ node -v
v10.16.0
puneets-MacBook-Pro:react-practice puneetrangrass$在我的机器里
节点: v10.16.0 npm : 6.9.0
同时在react中执行“npm”。我如何解决这个问题?
发布于 2021-11-19 21:10:40
我也犯了同样的错误:
TypeError: fsevents不是构造函数
解决方案:
在尚未弹出的任何已创建项目中,运行:
npm install --save --save-exact react-scripts@3.0.1或者:
yarn add --exact react-scripts@3.0.1参考资料:https://github.com/facebook/create-react-app/releases/tag/v3.0.1
https://stackoverflow.com/questions/57016380
复制相似问题