question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CLI: unexpected token '?'

See original GitHub issue

Description

Hi guys,

just created a new project and it is throwing this error when doing archive on iOS and when doing build on Android

Showing Recent Messages

  • /usr/local/bin/node /Users/hardik/Documents/GitHub/ReactNApp/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/hardik/Library/Developer/Xcode/DerivedData/ArcedirovNew-cdkamivgjmneqpgzgxxedswjccki/Build/Intermediates.noindex/ArchiveIntermediates/ReactNApp/BuildProductsPath/Release-iphoneos/main.jsbundle --assets-dest /Users/hardik/Library/Developer/Xcode/DerivedData/ReactNApp-cdkamivgjmneqpgzgxxedswjccki/Build/Intermediates.noindex/ArchiveIntermediates/ArcedirovNew/BuildProductsPath/Release-iphoneos/ArcedirovNew.app

/Users/hardik/Documents/GitHub/ReactNApp/node_modules/@react-native-community/cli/build/index.js:156

cmd.option(opt.name, opt.description ?? '', opt.parse || (val => val), typeof opt.default === 'function' ? opt.default(rest[0]) : opt.default);

Please advice how to fix this. thanks

Version

0.70.1

Output of npx react-native info

System: OS: macOS 13.0 CPU: (8) x64 Intel® Core™ i5-1038NG7 CPU @ 2.00GHz Memory: 365.09 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.15.0 - ~/.nvm/versions/node/v16.15.0/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 8.5.5 - ~/.nvm/versions/node/v16.15.0/bin/npm Watchman: 2022.02.28.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 Android SDK: API Levels: 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 Build Tools: 29.0.2, 29.0.3, 30.0.1, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0 System Images: android-21 | Google APIs Intel x86 Atom, android-22 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom, android-23 | Google APIs Intel x86 Atom_64, android-24 | Android TV Intel x86 Atom, android-24 | Intel x86 Atom, android-24 | Google Play Intel x86 Atom, android-25 | Google APIs ARM EABI v7a, android-25 | Google APIs Intel x86 Atom, android-25 | Google Play Intel x86 Atom, android-26 | Google Play Intel x86 Atom, android-27 | Intel x86 Atom, android-27 | Intel x86 Atom_64, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google Play Intel x86 Atom, android-31 | Google Play Intel x86 Atom_64, android-N | Android Wear ARM EABI v7a, android-N | Android Wear Intel x86 Atom, android-N | Intel x86 Atom, android-N | Intel x86 Atom_64 Android NDK: 21.3.6528147 IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9014738 Xcode: 14.0/14A309 - /usr/bin/xcodebuild Languages: Java: 18.0.2 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.1 => 0.70.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Trying to build on Android Archive on iOS for app store upload

Snack, code example, screenshot, or link to a repository

https://pasteboard.co/jF639A0h1o6b.png

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
liamjonescommented, Oct 4, 2022

@harrymash2006 you’re on 0.70.1 so you should be able to edit your ios/.xcode.env (or make an ios/.xcode.env.local) to override how it finds the node version to use

0reactions
adamTrzcommented, Oct 14, 2022

Hi @harrymash2006 have you tried the fixed mentioned above? I’ll close the issue for now but feel free to reopen if you still encounter problems when running the cli commands.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token "." · Issue #4340 · npm/cli - GitHub
Is there an existing issue for this? I have searched the existing issues. This issue exists in the latest npm version.
Read more >
Getting "Unexpected token = in JSON at position" error when ...
When using "=" in an anypoint-cli command, the escaping (\) doesn't work and produces the error "SyntaxError: Unexpected token = in JSON at ......
Read more >
sfdx-cli convert - SyntaxError: Unexpected token '.' post rollback
Since I reverted back I'm facing "SyntaxError: Unexpected token '.'" when performing an sfdx force:source:convert.
Read more >
in a simple "hello world" jest implementation, I get this error ...
in a simple "hello world" jest implementation, I get this error: SyntaxError: Unexpected token '.' Ask Question. Asked 2 months ago. Modified 19 ......
Read more >
Fix: Syntax Error near unexpected token `(' - Appuals.com
The error message syntax error near unexpected token `(' occurs in a Unix-type environment, Cygwin, and in the command-line interface in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found