Vscode-react-native: "unknown option `--root'" error with [email protected] during packager startup

Created on 9 Sep 2018  路  4Comments  路  Source: microsoft/vscode-react-native

Actual Behavior

  1. Opening command palette, selecting start pakager fails to run packager.
  2. It also shows a "unknown option --root" in the terminal

Expected Behavior

  1. Packager should be launched instantly

Software versions

  • React-Native VS Code extension version: 0.6.16
  • VSCode version: 1.27.1 (User Setup)
  • OS platform and version: Windows 10 x64 v 16299.611
  • NodeJS version: 8.11.4
  • React Native version: 0.57.0-rc.4
  • Expo SDK version (include if relevant):

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):

  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
[Info] Starting Packager


  error: unknown option `--root'

[Error] Failed to start the React Native packager

Stack: Error: Failed to start the React Native packager: Could not start the packager.
    at Function.getWrappedError (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\src\common\error\internalError.js:35:16)
    at Function.wrapError (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\src\common\error\errorHelper.js:18:44)
    at resultOfCode.done.reason (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\src\common\entryPointHandler.js:43:72)
    at _rejected (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:844:24)
    at C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:870:30
    at Promise.when (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:1122:31)
    at Promise.promise.promiseDispatch (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:788:41)
    at C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:604:44
    at runSingle (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:137:13)
    at flush (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):
[Extension Host] (node:13544) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
t.log @ console.ts:136
t._logExtensionHostMessage @ extensionHost.ts:412
(anonymous) @ extensionHost.ts:224
emitTwo @ events.js:126
emit @ events.js:214
emit @ internal/child_process.js:772
_combinedTickCallback @ internal/process/next_tick.js:141
_tickCallback @ internal/process/next_tick.js:180
notificationsAlerts.ts:39 Error: Could not start the packager.
    at Q.then.then.conditionResult (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\src\common\node\promise.js:52:23)
    at _fulfilled (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:834:54)
    at self.promiseDispatch.done (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:796:13)
    at C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:556:49
    at runSingle (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:137:13)
    at flush (C:\Users\reza\.vscode\extensions\vsmobile.vscode-react-native-0.6.16\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

RN 0.56 had some problems in windows, it has been fixed in 0.57-rc, but I cant run metro bundler from inside of vscode now. If I launch metro manually, debugger and other features will work as expected.

bug fix-in-master

Most helpful comment

Apologies for barging into a closed issue...

Is there an imminent release with this fix, or is it possible for me to roll my own extension direct from master (I know nothing about the way VSCode extensions work!)?

All 4 comments

It seems that the plugin cannot correctly detect if the project is an Expo project or not.

Apologies for barging into a closed issue...

Is there an imminent release with this fix, or is it possible for me to roll my own extension direct from master (I know nothing about the way VSCode extensions work!)?

@aidanw Did you find any solution to build the extension from master directly?

No, but if you start the packager in a command line (react-native start) then you can do 'run Android' from within vscode and it uses the started packager.

It gets confused sometimes but then I just kill and restart the command line.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AlexandreLouisnard picture AlexandreLouisnard  路  3Comments

buddhamangler picture buddhamangler  路  5Comments

andreyleonardo picture andreyleonardo  路  3Comments

vsccarl picture vsccarl  路  3Comments

kevinnguy picture kevinnguy  路  3Comments