Skip to content

"Embed Manifest" script phase fails if node's path contains a space #2283

@kraenhansen

Description

@kraenhansen

What happened?

I believe the code generated here doesn't properly escape the node_bin path - as an example this was generated into (node_modules/.generated/ios/.env) when using FNM to manage node version:

export PATH=/Users/kraen.hansen/Library/Application Support/fnm/node-versions/v20.16.0/installation/bin:$PATH

This fails to source from the build phase script, because of the space in "Application Support".

Version

3.10.15

What platforms are you seeing this issue on?

  • Android
  • iOS
  • macOS
  • visionOS
  • Windows

System Information

info Fetching system and libraries information...
System:
  OS: macOS 14.7
  CPU: (14) arm64 Apple M3 Max
  Memory: 250.50 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.16.0
    path: ~/.local/state/fnm_multishells/49336_1729246428602/bin/node
  Yarn: Not Found
  npm:
    version: 10.8.1
    path: ~/.local/state/fnm_multishells/49336_1729246428602/bin/npm
  Watchman:
    version: 2024.07.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11567975
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: true
iOS:
  hermesEnabled: false
  newArchEnabled: false

Steps to Reproduce

  1. Use FNM to manage your node installation and verify that your node-path contains a space after installation.
  2. Initialize the React Native Test App template
  3. Run pod-install
  4. Try compiling the app via XCode and observe how the "Embed Manifest" build phase fail.

"Command PhaseScriptExecution failed with a nonzero exit code"

.env: line 1: export: `Support/fnm/node-versions/v20.16.0/installation/bin:/Applications/Xcode-15.3.0.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/PlugIns/XCBSpecifications.ideplugin/Contents/Resources:/Applications/Xcode-15.3.0.app/Contents/SharedFrameworks/XCBuild.framework/Versions/A/PlugIns/XCBBuildService.bundle/Contents/PlugIns/XCBSpecifications.ideplugin:/Applications/Xcode-15.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/appleinternal/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/libexec:/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/appleinternal/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/usr/local/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/local/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/usr/bin:/Applications/Xcode-15.3.0.app/Contents/Developer/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin': not a valid identifier
/Users/kraen.hansen/Library/Developer/Xcode/DerivedData/ReactNativeWasmTester-aflfiataifgtuueqcnkpjchdrakt/Build/Intermediates.noindex/ReactTestApp.build/Debug-iphonesimulator/ReactTestApp.build/Script-1936CB1C2768EC280085FD98.sh: line 3: node: command not found

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions