yarn install > fsevents > "Error: spawn node-gyp ENOENT"

Please provide the following:

  1. SDK Version:
  2. Platforms(Android/iOS/web/all):
  3. Add the appropriate “Tag” based on what Expo library you have a question on.
    "expo": "~41.0.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",

% node --version
v14.0.0
% yarn --version
1.22.4
% expo --version
4.4.8

Mac OSX 11.2.3

yarn install:

[4/4] 🔨  Building fresh packages...
[1/4] ⠈ core-js
[2/4] ⠈ fsevents
[3/4] ⠈ core-js
warning Error running install script for optional dependency: "/Users/masao/simple/monkey-memory/node_modules/metro-core/node_modules/fsevents, /Users/masao/simple/monkey-memory/node_modules/metro/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /Users/masao/simple/monkey-memory/node_modules/metro-core/node_modules/fsevents
Output:
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',
  path: 'node-gyp',
success Saved lockfile.
✨  Done in 27.69s.

On expo start:

Failed to construct transformer:  TypeError: fsevents is not a function
    at new FSEventsWatcher (/Users/masao/simple/monkey-memory/node_modules/metro/node_modules/jest-haste-map/build/lib/FSEventsWatcher.js:162:20)
    at createWatcher (/Users/masao/simple/monkey-memory/node_modules/metro/node_modules/jest-haste-map/build/index.js:1052:23)
    at Array.map (<anonymous>)
...

On loading app in Expo Go, it gets stuck at:

New update available, downloading...

I tried:

  • Delete node_modules and yarn.lock and reinstall – no difference
  • yarn cache clean and reinstalled – no difference

Packages:

  "dependencies": {
    "@expo/vector-icons": "^12.0.0",
    "@react-native-community/masked-view": "0.1.10",
    "@react-navigation/bottom-tabs": "5.11.2",
    "@react-navigation/native": "~5.8.10",
    "@react-navigation/stack": "~5.12.8",
    "expo": "~41.0.1",
    "expo-asset": "~8.3.1",
    "expo-auth-session": "~3.2.3",
    "expo-constants": "~10.1.3",
    "expo-font": "~9.1.0",
    "expo-linking": "~2.2.3",
    "expo-random": "~11.1.2",
    "expo-splash-screen": "~0.10.2",
    "expo-status-bar": "~1.0.4",
    "expo-web-browser": "~9.1.0",
    "node-fetch": "^2.6.1",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
    "react-native-gesture-handler": "~1.10.2",
    "react-native-paper": "^4.8.1",
    "react-native-reanimated": "~2.1.0",
    "react-native-safe-area-context": "3.2.0",
    "react-native-screens": "~3.0.0",
    "react-native-web": "~0.13.12"
  },
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@types/react": "~16.9.35",
    "@types/react-native": "~0.63.2",
    "jest-expo": "~41.0.0",
    "typescript": "~4.0.0"
  },

install watchman: Installation - Expo Documentation

as for why fsevents failed to install on your machine, i cannot say, you should search on the fsevents repo

1 Like

Hi @notbrent – thanks for the quick reply.

I just installed watchman (and updated brew in the process):

I’m running this version:

% watchman version
{
    "version": "4.9.0"
}

What version are you running?

Also tried brew reinstall watchman – no effect

I’m going to update Big Sur to 11.3.1 and reinstall and see if that helps.

it could be an issue with your node version. any particular reason you’re using version 14.0.0? as far as i know that particular version is no longer supported, you should use 14.17.0.

edit: yeah, node lts starts at 14.15.0, and any v14 version below that is considered unsupported - node/CHANGELOG_V14.md at master · nodejs/node · GitHub

1 Like

Thanks for pointing that out @notbrent . It was indeed v14 of Node, which was a PATH’ing problem on my Mac, where I had v16, but was not using it.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.