File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
packages/react-native/scripts/cocoapods Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -236,16 +236,9 @@ def self.create_xcode_env_if_missing(file_manager: File)
236
236
if !file_manager . exist? ( "#{ file_path } .local" )
237
237
# When installing pods with a yarn alias, yarn creates a fake yarn and node executables
238
238
# in a temporary folder.
239
- # Using `type -a` we are able to retrieve all the paths of an executable and we can
240
- # exclude the temporary ones.
239
+ # Using `node --print "process.argv[0]";` we are able to retrieve the actual path from which node is running.
241
240
# see https://github.com/facebook/react-native/issues/43285 for more info
242
- node_binary = `type -a node` . split ( "\n " ) . map { |path |
243
- path . gsub! ( "node is " , "" )
244
- } . select { |b |
245
- !b . start_with? ( "/var" )
246
- }
247
-
248
- node_binary = node_binary [ 0 ]
241
+ node_binary = `node --print "process.argv[0]";`
249
242
system ( "echo 'export NODE_BINARY=#{ node_binary } ' > #{ file_path } .local" )
250
243
end
251
244
end
You can’t perform that action at this time.
0 commit comments