i'm new to react native and i've been following https://reactnative.dev/docs/environment-setup and in the 'Start Metro' step, npx react-native start doesn't work
pls help
Please make sure you installed Node first with Homebrew:
brew install node
brew install watchman
Try yarn start or npm start after you installed node.
Related
I am receiving an error while trying to use Typescript with my existing expo project.
While following the docs, I created a tsconfig.json file in the project root.
When running expo start, I am prompted to install the typescript dependencies. However, after these are successfully installed (tick message appears in console: √ Installed typescript#~4.3.5, #types/react#~17.0.21, #types/react-native#~0.67.6), I receive the following error:
It looks like you're trying to use TypeScript but don't have the required dependencies installed.
Please install #types/react by running:
yarn add --dev #types/react#~17.0.21
If you're not using TypeScript, please remove the TypeScript files from your project and delete the tsconfig.json.
error Command failed with exit code 1.
After following the instructions and running the yarn add .... command, I keep seeing the same error message.
I have tried deleting the node_modules folder and package-lock.json file to no avail. I have also tried following this answer.
Any assistance would be appreciated, thank you.
Seems to be a bug. It works if I install #types/react on the specific version that Expo requests (17.0.21).
yarn add --dev #types/react#17.0.21
Just re-install expo-cli npm install -g expo-cli.
I don't know which of the following worked, but I ran the following commands and the problem went away.
sudo npm install -g expo-cli
sudo npm install -g #types/react
sudo npm install -g #types/react-native
sudo npm install -g typescript
yarn add expo-cli
solved for me.
I had the same issue. I resolved it by :
1- delete the node_modules.
2- update expo to the latest version using npm i -g expo-cli
hope this will help someone
if you installed #types/react remove that from your dev dependencies
I want to start developing native apps with react-native and i am also using VScode as my code editor, i keep running in to error when trying to start my project using this command "expo init First project", so how do you think i can overcome this error
You should first install the expo-cli with npm install --global expo-cli before starting a project
Once you have Node.js installed run the following command:
npm install -g expo-cli
After successfully installing the Expo CLI you can initialize a brand new project by running the following command:
expo init <name of project goes here>
cd <name of project goes here>
npm start
Below is an example of how this will work:
expo init my-todo-app
cd my-todo-app
npm start
I am trying to run react native expo, it runsbefore but after try to build an apk, it doest work anymore.
here the error below.
I tried npm start and expo start it doesn't work.
I'd suggest to install the expo-cli globally. In the future you use the cool features that are provided by this cli. Like expo init.
npm install expo-cli -g
This is my first React + Redux project, it works when I run it in my PC but when people follow my github instructions to run the project on their computers they get an error. "command not found: yarn"
Can anyone help me with this issue please? I wonder if my instructions are wrong in the first place
https://github.com/itsandromeda/Shoes-Store
If anyone gets to launch it succesfully without any errors please let me know.
Instructions:
Install dependencies
npm install
Install json server
npm install -g json-server
Run json server
json-server --watch db.json --port 3001
Launch project
yarn start
It all worked for me. I'm using node v8.9.4 and npm 5.6.0
Facing problem of creating project in React Native (iOS ). i have installed the following commands successfully:
1. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2. npm install -g react-native-cli
3. brew install node
4. brew install watchman
5. brew install flow
When i run the command "react-native init AwesomeProject" , it shows following error;
-bash: react-native: command not found
FYI : In my mac home directory, it just create a file name "npm-debug.log".
I can't proceed on.
How i can create and run a project ?
My directory is: