In order to install react and create an app using create-react-app on Termux you have to do the following:
Install npx if you haven't done so:
$ npm install -g npx
Install create-react-app
$ npm install create-react-app -g
Clean your npm cache to avoid the 'ERR! cb() never called!' error
$ npm cache clean --force
If you want to create an app called 'apprx' first create the folder and then open it:
mkdir apprx && cd apprx
now create the following file;
$ touch .gitignore
Go back up one level
$ cd ../
Run the 'create-react-app':
$ npx create-react-app apprx
It will take a while but it will setup. Once done:
$ cd apprx
Start the app
$ npm start
Tested this on a Huawei M5 8, Samsung Note 8,
sir can i install this in sdcard com.termux/data pls reply
ReplyDeleteYes I can install like that, thanks for blogs owner
DeleteI am getting this error.
ReplyDeleteError: EPERM: operation not permitted, symlink '../../../../browserslist/cli.js' -> '/storage/emulated/0/app/node_modules/@babel/compat-data/node_modules/.bin/browserslist'
type $ termux-setup-storage
Deleteit will allow permisson of read localstorage
This is because you didn't created .gitignore file manually.
ReplyDeleteError
ReplyDeletenpm ERR! Maximum call stack size exceeded
npm ERR! A complete log of this run can be found in:
npm ERR! /data/data/com.termux/files/home/.npm/_logs/2020-10-24T02_18_57_947Z-debug.log
your size memory is low bunny
Deletehome diectory path for sdcard
ReplyDeletechange bash.bashrc file of etc directory
create folder termuxhome in sdcard
add lines in bash.bash.rc by nano
HOME=/storage/emulated/0/termuxhome
cd $HOME
Error: Package exports for '/data/data/com.termux/files/home/my-app/node_modules/postcss-safe-parser/node_modules/postcss' do not define a valid '.' target
ReplyDeleteError ELIFECYCLE ..help😢
ReplyDeleteAborting installation.
ReplyDeletenpm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting apprx/ from /data/data/com.termux/files/home/app