簡體   English   中英

錯誤:`fsevents` 不可用(這個觀察器只能在 Darwin 上使用)

[英]Error: `fsevents` unavailable (this watcher can only be used on Darwin)

我正在本地環境中克隆現有的 react native 應用程序,但是每次運行react-native run-ios ,都會出現以下錯誤:

** BUILD FAILED **


The following commands produced analyzer issues:
    Analyze /Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c normal x86_64

    Analyze /Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c normal x86_64
    Analyze Base/RCTModuleMethod.mm normal x86_64
(3 commands with analyzer issues)

The following build commands failed:
    Ld build/Build/Products/Debug-iphonesimulator/MyUros.app/MyUros normal x86_64
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/TPP.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/TPP.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

而 react-packager 中的這個錯誤:

Loading dependency graph...(node:52097) UnhandledPromiseRejectionWarning: Error: `fsevents` unavailable (this watcher can only be used on Darwin)
    at new FSEventsWatcher (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/sane/src/fsevents_watcher.js:41:11)
    at createWatcher (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/jest-haste-map/build/index.js:600:23)
    at Array.map (<anonymous>)
    at HasteMap._watch (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/jest-haste-map/build/index.js:747:25)
    at _buildPromise._buildFileMap.then.then.hasteMap (/Users/alydabbous/code/Dabbous-Innopay/ideal-app/node_modules/jest-haste-map/build/index.js:279:21)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
(node:52097) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:52097) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

當我為克隆的 repo 運行react-native run-ios時,我只會收到此錯誤。 但是當我創建一個新的 react-native 應用程序時,一切正常。 我嘗試了一切:殺死服務器,再次卸載和安裝節點,刪除我的 node_modules 文件等,但仍然無法解決這個問題。 任何幫助將非常感激。 謝謝。

對我來說,我卸載了watchman ,然后使用brew重新安裝它,如下所示:

npm r -g watchman 
brew install watchman
npm install -g fsevents

為我工作

我在編寫 React Native 應用程序時遇到了以下問題。 watchman 似乎是一個錯誤,所以我們只需要重新安裝它:

brew remove watchman

brew install watchman

我希望它有幫助,

嘗試運行 jest watch 時遇到了同樣的錯誤。 對我來說,簡單的解決方案是通過 npm 安裝 fsevents 模塊(我認為這是您的錯誤消息告訴您的)。 我也在使用 React 應用程序並遇到了其他類似的錯誤。

希望這可以幫助!

這發生在我的create-react-app中。 我通過更新react-scripts解決了這個問題

yarn add react-scripts@latest

然后刪除node_modules ,並重新安裝

yarn

卸載 watchman 然后用 brew 重新安裝工作:

npm r -g 守望者

釀造安裝守望者

就我而言,在 MacOS 更新之后,我需要更新版本的yarn

curl --compressed -o- -L https://yarnpkg.com/install.sh | bash

有時,此問題可能與您運行的節點版本有關。 如果您使用的是 nvm,請嘗試切換到不同的節點版本並查看它是否已修復。 它在類似的問題上對我有用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM