Compilation issue in react native project with yarn
Tags: reactnative, reactjsdevelopment, devops, javascript
Published: 2023-06-07 11:34:20

Hello everyone,

I'm currently experiencing a compilation issue in my React Native project while installing node_modules with Yarn. I would greatly appreciate your prompt assistance.

Project Details:

Node version: 10
React Native version: 0.61.2
Package Manager: Yarn
Operating System: Mac M1

Issue (Error):

ValueError: invalid mode: 'rU' while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/jaykesh/.nvm/versions/node/v10.24.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 21.6.0
gyp ERR! command \"/Users/jaykesh/.nvm/versions/node/v10.24.1/bin/node\" \"/Users/jaykesh/.nvm/versions/node/v10.24.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node\" \"--module_name=fse\" \"--module_path=/Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64\" \"--napi_version=7\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v64\"
gyp ERR! cwd /Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents
gyp ERR! node -v v10.24.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/jaykesh/.nvm/versions/node/v10.24.1/bin/node /Users/jaykesh/.nvm/versions/node/v10.24.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Darwin 21.6.0
node-pre-gyp ERR! command \"/Users/jaykesh/.nvm/versions/node/v10.24.1/bin/node\" \"/Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fsevents
node-pre-gyp ERR! node -v v10.24.1
node-pre-gyp ERR! node-pre-gyp -v v0.12.0
node-pre-gyp ERR! not ok 
Failed to execute '/Users/jaykesh/.nvm/versions/node/v10.24.1/bin/node /Users/jaykesh/.nvm/versions/node/v10.24.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/jaykesh/Desktop/S2C-FFA/s2c-field-force/node_modules/jest-haste-map/node_modules/fs
$ npx jetify


Thank you for your assistance in advance.