can't build for web?

Thanks for a great product. Successfully built my first project and deployed for android and ios emulator. I wanted to deploy for local web testing, but no luck getting it to run

$ expo --version
2.6.14

$ expo --web
  error: unknown option `--web'

$ yarn web
yarn run v1.13.0
$ expo start --web

  error: unknown option `--web'

Press ? to show a list of all available commands.
Logs for your project will appear below. Press Ctrl+C to exit.

 › Press a to run on Android device/emulator, or i to run on iOS simulator.
 › Press c to show info on connecting new devices.
 › Press d to open DevTools in the default web browser.
 › Press shift-d to disable automatically opening DevTools at startup.
 › Press e to send an app link with email/SMS.
 › Press p to toggle production mode. (current mode: development)
 › Press r to restart bundler, or shift-r to restart and clear cache.
 › Press s to sign out. (Signed in as @bwalsh.)


Hi

Your version of expo-cli is too old. You’ll need to upgrade it.

This is normally done as follows:

npm install -g expo-cli

If you originally installed expo-cli using yarn, then you should do the following instead:

yarn global add expo-cli

Note: globally installed stuff (like expo-cli) and your app’s dependencies (listed in package.json) are separate from each other, so it is not uncommon to use npm to install the global stuff and yarn to install the app’s dependencies.

If you’re not sure whether you installed expo-cli using npm or yarn originally you could try this:

npm uninstall -g expo-cli
yarn global remove expo-cli
npm install -g expo-cli
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.