French
French

Reputation: 43

error opening web version react native in VS

I write in terminal npm start and after that I choose to run in web version. And i get this error I tried to fix this problem like that "npm install react-native-web" But it didn't work

Upvotes: 4

Views: 14598

Answers (5)

Amatak
Amatak

Reputation: 1

Just in case someone get face the issues. it works for window in my case.I did twice for the practicing No more errors I am ready to start on the project.

  1. first create app from "npx create-expo-app" as the root project not from React Native.
  2. cd [your app]
  3. npx react-native@latest init [yourapp]
  4. yarn add @expo/webpack-config

please noted use yarn to install webpack-config not npm install it not gonna work. done you are ready to go...

Upvotes: 0

ODHIAMBO Colince
ODHIAMBO Colince

Reputation: 1

After struggling all the day to find the solution, it finally solved it this way,

npx expo install expo/webpack-config -- --force.

Note: I'm working on windows computer

Upvotes: 0

Joeboulton
Joeboulton

Reputation: 320

Installing both with legacy peer deps worked for me

npm i react-native-web --legacy-peer-deps
npm i react-dom --legacy-peer-deps

Upvotes: 2

Rizwan Ramzan
Rizwan Ramzan

Reputation: 1

Install using this command:

  1. Open Visual Studio Code terminal in the folder to install
  2. npx expo install react-native-web@~0.18.7
  3. npm install @expo/webpack-config@^0.17.0
  4. npm install [email protected]
  5. Run this app with npm start

Upvotes: 0

try this command: expo start --web

Upvotes: 4

Related Questions