Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: SyntaxError: Unexpected token 'E', "Error: spawn ENOTDIR" is not valid JSON (Yarn Plug'n'Play) #6139

Closed
bitjson opened this issue Dec 2, 2022 · 3 comments Β· May be fixed by #7754
Closed

Comments

@bitjson
Copy link

bitjson commented Dec 2, 2022

Bug Report

Capacitor Version

❯ yarn cap doctor    
πŸ’Š   Capacitor Doctor  πŸ’Š 

Latest Dependencies:

  @capacitor/cli: 4.6.0
  @capacitor/core: 4.6.0
  @capacitor/android: 4.6.0
  @capacitor/ios: 4.6.0

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/cli: 4.5.0
  @capacitor/core: 4.5.0
  @capacitor/ios: 4.5.0

[success] iOS looking great! πŸ‘Œ

Platform(s)

  • iOS

Current Behavior

❯ yarn cap run ios -l --external      
βœ” Copying web assets from build to ios/App/App/public in 31.11ms
βœ” Creating capacitor.config.json in ios/App/App in 792.54ΞΌs
[info] Inlining sourcemaps
βœ” copy ios in 94.23ms
βœ” Updating iOS plugins in 6.29ms
[info] Found 4 Capacitor plugins for ios:
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
βœ” Updating iOS native dependencies with pod install in 3.25s
βœ” update ios in 3.27s
[error] SyntaxError: Unexpected token 'E', "Error: spawn ENOTDIR" is not valid JSON
        at JSON.parse (<anonymous>)
        at Object.getPlatformTargets
        (/[...]/.yarn/cache/@capacitor-cli-npm-4.5.0-b394afdec0-4e8a545462.zip/node_modules/@capacitor/cli/dist/util/native-run.js:39:26)
        at async Object.runIOS
        (/[...]/.yarn/cache/@capacitor-cli-npm-4.5.0-b394afdec0-4e8a545462.zip/node_modules/@capacitor/cli/dist/ios/run.js:13:59)
        at async run
        (/[...]/.yarn/cache/@capacitor-cli-npm-4.5.0-b394afdec0-4e8a545462.zip/node_modules/@capacitor/cli/dist/tasks/run.js:74:9)
        at async runCommand
        (/[...]/.yarn/cache/@capacitor-cli-npm-4.5.0-b394afdec0-4e8a545462.zip/node_modules/@capacitor/cli/dist/tasks/run.js:61:13)
        at async
        /[...]/.yarn/cache/@capacitor-cli-npm-4.5.0-b394afdec0-4e8a545462.zip/node_modules/@capacitor/cli/dist/index.js:123:9
        at async
        /[...]/.yarn/cache/@capacitor-cli-npm-4.5.0-b394afdec0-4e8a545462.zip/node_modules/@capacitor/cli/dist/telemetry.js:26:13
        at async Command.<anonymous>
        (/[...]/.yarn/cache/@capacitor-cli-npm-4.5.0-b394afdec0-4e8a545462.zip/node_modules/@capacitor/cli/dist/util/cli.js:12:13)

Expected Behavior

Expected to be able to run the app on an external device successfully.

Code Reproduction

ionic start blank blank --type=react --capacitor
cd blank
yarn set version latest
yarn capacitor add ios
yarn cap run ios -l --external
# or: yarn ionic cap run ios -l --external

Other Technical Details

yarn --version output: 3.3.0

node --version output: v19.2.0

pod --version output (iOS issues only): 1.11.3

@jcesarmobile
Copy link
Member

Can you provide a sample app?
Those steps to reproduce don't seem correct, yarn capacitor add ios should fail as you haven't installed @capacitor/ios and yarn cap run ios -l --external is not correct neither, -l --external have no effect on capacitor run command, maybe you are using ionic instead of yarn? (i.e. ionic capacitor add ios)

Can you run npx native-run ios --list --json? looks like it's returning some error instead of the json with the list of the simulator/devices you have.

@jcesarmobile jcesarmobile added the needs reply needs reply from the user label Dec 5, 2022
@Ionitron
Copy link
Collaborator

It looks like this issue didn't get the information it needed, so I'll close it for now. If I made a mistake, sorry! I am just a bot.

Have a great day!
Ionitron πŸ’™

@Ionitron Ionitron removed the needs reply needs reply from the user label Dec 21, 2022
@ionitron-bot
Copy link

ionitron-bot bot commented Jan 20, 2023

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants