首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >fsevents不是构造函数。

fsevents不是构造函数。
EN

Stack Overflow用户
提问于 2019-07-13 05:18:00
回答 1查看 3.5K关注 0票数 2

启动开发服务器..。

代码语言:javascript
复制
/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”。我如何解决这个问题?

EN

回答 1

Stack Overflow用户

发布于 2021-11-19 21:10:40

我也犯了同样的错误:

TypeError: fsevents不是构造函数

解决方案:

在尚未弹出的任何已创建项目中,运行:

代码语言:javascript
复制
npm install --save --save-exact react-scripts@3.0.1

或者:

代码语言:javascript
复制
yarn add --exact react-scripts@3.0.1

参考资料:https://github.com/facebook/create-react-app/releases/tag/v3.0.1

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57016380

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档