简体   繁体   English

错误:在 CRA v2.1.7 和 craco v3.5.0 中,`fsevents` 不可用(此观察程序只能在 Darwin 上使用)

[英]Error: `fsevents` unavailable (this watcher can only be used on Darwin) in CRA v2.1.7 and craco v3.5.0

I am getting the above error while running jest v23 in a monorepo.在 monorepo 中运行 jest v23 时出现上述错误。 The package i am running jest on is built on CRA and craco.我正在开玩笑的包是建立在 CRA 和 craco 上的。 Package.json of my CRA我的 CRA 的 Package.json

{
  "name": "@sprinklr/chat-web-client",
  "version": "0.1.0",
  "dependencies": {
    "@emotion/core": "^10.0.5",
    "@emotion/styled": "^10.0.5",
    "@sentry/browser": "^5.8.0",
    "@sentry/integrations": "^5.8.0",
    "@sprinklr/chat-constants": "2.0.0",
    "@sprinklr/chat-entities": "2.0.0",
    "@sprinklr/chat-utils": "2.0.0",
    "@sprinklr/rest-client": "2.0.0",
    "azure-storage": "^2.10.3",
    "bluebird": "^3.4.0",
    "classnames": "^2.2.6",
    "core-js": "^3.0.1",
    "emotion": "^10.0.2",
    "emotion-theming": "^10.0.5",
    "formik": "^1.3.2",
    "immutability-helper": "^2.8.1",
    "jstz": "^2.1.1",
    "lodash": "^4.17.4",
    "polished": "^2.3.0",
    "prop-types": "^15.5.7",
    "react": "^16.8.6",
    "react-autosize-textarea": "^6.0.0",
    "react-dom": "^16.8.6",
    "react-frame-component": "^4.0.2",
    "react-redux": "7.2.0",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "react-scripts": "2.1.7",
    "react-transition-group": "^2.5.3",
    "react-use": "^14.1.1",
    "redux": "^4.0.0",
    "redux-logger": "^3.0.6",
    "redux-saga": "^1.0.1",
    "reselect": "^4.0.0",
    "scriptjs": "^2.5.8",
    "shortid": "^2.2.14",
    "styled-system": "^3.0.2",
    "typesafe-actions": "^2.0.4",
    "validate.js": "^0.13.1"
  },
  "scripts": {
    "precommit": "pretty-quick --staged",
    "start": "sh internals/build/build-packages.sh && craco start --workspace",
    "prebuild": "NODE_ENV=production babel-node internals/build/tools/run prebuild",
    "build": "sh internals/build/build.sh",
    "analyze": "source-map-explorer build/static/js/main.*",
    "eject": "react-scripts eject",
    "docz:dev": "docz dev",
    "docz:build": "docz build",
    "static": "NODE_ENV=production babel-node internals/build/tools/run static/index",
    "widget": "NODE_ENV=production babel-node internals/build/tools/run widget/index",
    "i18n": "sh internals/i18n/index.sh",
    "lint": "eslint src",
    "format": "npm run prettier -- --write",
    "prettier": "prettier \"**/*.+(js|jsx|json|yml|yaml|css|less|scss|ts|tsx|md|graphql|mdx)\"",
    "validate": "npm run lint && npm run prettier -- --list-different",
    "test": "craco test --workspace --env=jsdom",
    "test-watch": "npm run test -- --watch",
    "test-coverage": "npm run test -- --coverage",
    "test-update": "npm run test -- --updateSnapshot"
  },
  "devDependencies": {
    "@babel/cli": "7.2.3",
    "@babel/core": "7.2.2",
    "@babel/node": "7.2.2",
    "@babel/preset-env": "^7.3.1",
    "@craco/craco": "^3.5.0",
    "@emotion/babel-preset-css-prop": "^10.0.7",
    "@sprinklr/chat-types": "2.0.0",
    "@testing-library/jest-dom": "4.2.4",
    "@testing-library/react": "^9.4.0",
    "@types/bluebird": "^3.5.26",
    "@types/classnames": "^2.2.7",
    "@types/jest": "26.0.0",
    "@types/lodash": "^4.14.118",
    "@types/node": "^11.13.7",
    "@types/react": "^16.8.14",
    "@types/react-dom": "^16.8.4",
    "@types/react-intl": "^2.3.15",
    "@types/react-redux": "^7.1.0",
    "@types/react-router": "^4.4.2",
    "@types/react-textarea-autosize": "^4.3.3",
    "@types/react-transition-group": "^2.0.15",
    "@types/redux-logger": "^3.0.6",
    "@types/scriptjs": "^0.0.2",
    "@types/shortid": "^0.0.29",
    "@types/styled-system": "^3.0.8",
    "aws-sdk": "^2.392.0",
    "babel-plugin-lodash": "^3.3.4",
    "babel-plugin-named-asset-import": "^0.2.3",
    "babel-plugin-react-intl": "^3.0.1",
    "babel-plugin-react-intl-auto": "^1.6.0",
    "babel-preset-react-app": "^7.0.0",
    "cheerio": "^1.0.0-rc.2",
    "docz": "^0.12.15",
    "eslint-plugin-prettier": "^2.6.2",
    "glob": "^7.1.2",
    "husky": "^0.14.3",
    "node-sass-chokidar": "^1.3.0",
    "prettier": "1.13.7",
    "pretty-quick": "^1.6.0",
    "react-intl": "^2.8.0",
    "source-map-explorer": "^1.5.0",
    "terser": "3.16.1",
    "ts-jest": "26.1.1",
    "tslint": "^5.11.0",
    "tslint-config-prettier": "^1.16.0",
    "tslint-react-hooks": "^1.1.0",
    "typescript": "3.4.5",
    "typescript-styled-plugin": "^0.13.0",
    "webpack-merge": "^4.1.4"
  },
  "optionalDependencies": {
    "fsevents": "1.2.4"
  },
  "browserslist": [
    ">1%",
    "last 4 versions",
    "Firefox ESR",
    "not ie < 11"
  ]
}

I checked my node_modules and it has fsevents installed.我检查了我的 node_modules 并安装了 fsevents。 Still getting the error.仍然收到错误。 Most common solution which I found was reinstalling node_modules after deleting yarn.lock but this solution isn't working for me.我发现的最常见的解决方案是在删除 yarn.lock 后重新安装 node_modules,但此解决方案对我不起作用。 Neither installing watchman worked.安装守望者都没有工作。 I am using jestConfig of CRA itself我正在使用 CRA 本身的 jestConfig

通过安装 brew 然后在我的 mac 上执行brew install watchman解决了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 v2.0 开始,“injectBabelPlugin”助手已被弃用。 您可以使用自定义 cra 插件代替 - The “injectBabelPlugin” helper has been deprecated as of v2.0. You can use customize-cra plugins in replacement npm WARN 已弃用 fsevents@1.2.4:fsevents 1 将在节点 v14+ 上中断 - npm WARN deprecated fsevents@1.2.4: fsevents 1 will break on node v14+ (反应路由器 v6)“错误:useNavigate() 只能在<router>特定组件中的组件”错误</router> - (react router v6) "Error: useNavigate() may be used only in the context of a <Router> component" error in hoc component MUI v5:失败的道具类型:`Grid` 的道具`direction` 只能与`container` 道具一起使用 - MUI v5: Failed prop type: The prop `direction` of `Grid` can only be used together with the `container` prop React Router V6 - 错误:useRoutes() 只能在 a 的上下文中使用<router>成分</router> - React Router V6 - Error: useRoutes() may be used only in the context of a <Router> component 代码拆分不适用于 CRA + React Route v4 + 代码拆分 - Code Splitting not working with CRA + React Route v4 + Code Splitting 路线只能用作的孩子<routes>元素,在 React 路由器 v6 中</routes> - A Route is only ever to be used as the child of <Routes> element, in React router v6 如何在CRA v2中将代理值从package.json移动到setupProxy.js? - How to move a proxy value from package.json to setupProxy.js in CRA v2? 从parcel v1 -&gt; CRA 切换,如何在开发过程中重新加载静态网页文件 - Switch from parcel v1 -> CRA, how to serve static web file with reload during development Serviceworker - WorkBox v3.5 在 CRA 中“找不到注入清单的地方” - Serviceworker - WorkBox v3.5 “Unable to find a place to inject the manifest” in CRA
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM