'cb.apply is not a function' error running 'npx react-native init' - react-native

I want to learn React Native, so i read documents in Offical Site and I install some softwares. I installed JDK, Android Studio, NodeJs, Watchman..
At the least, When i use this command:
npx react-native init AwesomeProject
I got error:
npm ERR! cb.apply is not a function
I tried to graceful, but it didn't work.
npm install graceful-fs --save-dev
So what should I do ?
I'm using Linux Mint 18.

you most install npm:
install npm
than install react-native :
npm install -g
react-native-cli && npm install -g react-native (admin or sudo)
then for create project use:
react-native init MyProject
than go to project folder with :
cd Myproject
and finally use this for run project:
react-native run-ios or run-android

Related

npx react-native init , not creating project

when I run new project command it shows me an error
npx react-native init AwesomProject
npm ERR! Could not install from "computer\AppData\Roaming\npm-cache_npx\15660" as it does not contain a package.json file.
try this : npm uninstall -g react-native-cli #react-native-community/cli
or
use Expo

react-native init is empty upon creation

i'm upgrading to react-native to the latest.
I'm following this https://reactnative.dev/docs/0.68/environment-setup
with current setup
ruby 2.7.5 (using rvm)
gem 3.1.6
node 14
after running this command
npx react-native init AwesomeProject
I only got this on my folder
Thank you.
Sorry,
I just fixed it by reinstalling these
npm uninstall -g react-native
npm uninstall -g react-native-cli
npm install -g react-native-cli
npm install -g react-native

react-native -bash: react-native: command not found

I Install node and Watchman
brew install node
brew install watchman
then Install React Native CLI
npm install -g react-native-cli
but when I use react-native init test
I have error:
-bash: react-native: command not found
try: sudo npm install -g react-native-cli
or npx before react native as: npx react-native init demo
first
sudo npm install -g react-native-cli
this command output path like this
/usr/local/bin/react-native -> /usr/local/lib/node_modules/react-native-cli/index.js
then(for above path example)
export PATH="/usr/local/lib/node_modules/react-native-cli/index.js"
react-native init appName

npm error while creating react native app

I used following command
npm install -g create-react-native-app
create-react-native-app AwesomeProject
cd AwesomeProject
npm start
but it showing me following error.
anyone can help?
Update your:
Node version to the latest
npm (npm install -g npm#latest)
yarn (npm install --g yarn).
And try again to run create-react-native-app AwesomeProject

Command "react-native" can not run after installed react-native-drawer

I inited React native project by:
react-native init MyShop
In MyShop folder, I install "react-native-drawer":
npm install --save react-native-drawer
After install, I run project by:
react-native run-android
And get error "Command run-android unrecognized. Make sure that you have run npm install and that you are inside a react-native project."
I checked react-native by command line
react-native -v
And get info:
react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory
It seems react-native lib has been removed after installed react-native-drawer.
My npm version:
E:\2.Projects\My\MyShop>npm -v
5.0.4
My node version:
E:\2.Projects\My\MyShop>node -v
v8.1.2
Please help me re-procedure and fix it. Thank you!
I found out solution for this issue!
I update npm to latest version: 5.1.0.
Uninstall react-native-cli:
npm uninstall -g react-native-cli
Next, reinstall react-native-cli:
npm install -g react-native-cli
My issue has been fixed.
Install react-native without -cli
npm install -g react-native
It will fix the issue......Hopefully....coz