I have a problem with running a react native app using expo - javascript

C:\Users\ADMIN\Documents\Sunny\fitnessApp\node_modules#expo\cli\build\src\utils\downloadExpoGoAsync.js:78
bar.update(progress, total);
^
TypeError: Cannot read properties of null (reading 'update')
at Object.onProgress (C:\Users\ADMIN\Documents\Sunny\fitnessApp\node_modules#expo\cli\build\src\utils\downloadExpoGoAsync.js:78:25)
at onProgress (C:\Users\ADMIN\Documents\Sunny\fitnessApp\node_modules#expo\cli\build\src\api\rest\wrapFetchWithProgress.js:52:61)
at PassThrough. (C:\Users\ADMIN\Documents\Sunny\fitnessApp\node_modules#expo\cli\build\src\api\rest\wrapFetchWithProgress.js:44:21)
at PassThrough.emit (node:events:525:35)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at node:internal/streams/transform:182:12
at PassThrough._transform (node:internal/streams/passthrough:46:3)
at Transform._write (node:internal/streams/transform:175:8)
Node.js v18.13.0
I want to run successfully on my virtual device android.

Not sure where exactly the issue is but its some expo internal issue you may try these commands to fix this.
1.Update the expo cli by running npm install -g expo-cli#latest.
2.Or.. you can run the command expo doctor.
3.Delete the node_modules folder and run npm install again to reinstall all dependencies
4.Try running expo start and see if it reports any issues with your setup.

Related

npm run start with error "EMFILE: too many open files"

I done npm update and broke start project. Using npm run start returns an error:
10% building 0/1 entries 0/0 dependencies 0/0 modulesnode:internal/errors:484
ErrorCaptureStackTrace(err);
^
Error: EMFILE: too many open files, watch
at FSWatcher._handle.onchange (node:internal/fs/watchers:204:21)
Emitted 'error' event on FSWatcher instance at:
at FSWatcher._handleError (/Users/199/WebstormProjects/isu_frontend_common/node_modules/chokidar/index.js:647:10)
at NodeFsHandler._boundHandleError (/Users/199/WebstormProjects/isu_frontend_common/node_modules/chokidar/lib/nodefs-handler.js:303:43)
at /Users/199/WebstormProjects/isu_frontend_common/node_modules/chokidar/lib/nodefs-handler.js:137:5
at foreach (/Users/199/WebstormProjects/isu_frontend_common/node_modules/chokidar/lib/nodefs-handler.js:41:5)
at fsWatchBroadcast (/Users/199/WebstormProjects/isu_frontend_common/node_modules/chokidar/lib/nodefs-handler.js:136:3)
at FSWatcher.<anonymous> (/Users/199/WebstormProjects/isu_frontend_common/node_modules/chokidar/lib/nodefs-handler.js:185:9)
at FSWatcher.emit (node:events:513:28)
at FSWatcher._handle.onchange (node:internal/fs/watchers:210:12) {
errno: -24,
syscall: 'watch',
code: 'EMFILE',
filename: null
}
Node.js v18.12.1
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 17332.
I've already tried:
Removing node_modules and package-lock.json, clean cache and npm install
Switch Node.js and NPM versions to lastest stable
Installing the project again in another folder
But it didn't help me. What else can I do?
Judging of your filepath's it seems like you are using MacOS. I have experienced this issue a few times on my macbook m1 silicone and was able to resolve this issue by installing Watchman. You can simply do that with the help of brew.
First update brew;
brew update
then execute this command;
brew install watchman
Let me know if this solved your issue.
npm install graceful-fs
It resolve my problem.

expo-cli is installed correctly but run with some errors

I installed expo-cli globally on my machine to start working with react-native, the files of expo are located in the C:\\users\username\node_modules. Despite of installing it globally, windows command line (cmd) doesn't recognize the command expo.
To make the expo command global, i added the path C:\Users\username\node_modules\.bin to environment variables, so the problem of using expo command is solved, i can use it to create a simple react-native application.
When i try to run the application using:
expo start --web
i get the following error:
D:\Testing\myapp>expo start --web
Starting project at D:\Testing\myapp
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Please help me to fix it.
This is a strange error. ENOENT means file not found and spawn cmd means it's trying to run something. One possible fix I found is, editting your state.json file in the location HOMEPATH\.expo\state.json.
Add "openDevToolsAtStartup": false above the PATH line.
Hope this works for you.
Note: If you're using Windows 10, your state.json file will be in C:\Users\your-username\.expo\state.json

Facing error (0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart is not a function on expo init

I am trying to create react native application with Expo. As per react native official documentation, I have installed Node 8+ (v8.12.0) & expo-cli on my windows system and then run command expo init AwesomeProject. But its giving error as
(0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart is not a function
Set EXPO_DEBUG=true in your env to view the stack trace.
When I enable expo debug, its giving
TypeError: (0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart
is not a function
at C:\expo-cli#2.11.6\src\commands\init.js:105:19
at Array.map (<anonymous>)
at _callee$ (C:\expo-cli#2.11.6\src\commands\init.js:95:37)
at tryCatch (C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\no
de_modules\regenerator-runtime\runtime.js:62:40)
at Generator.invoke [as _invoke] (C:\Users\shubhamt1\AppData\Roaming\npm\nod
e_modules\expo-cli\node_modules\regenerator-runtime\runtime.js:296:22)
at Generator.prototype.(anonymous function) [as next] (C:\Users\shubhamt1\Ap
pData\Roaming\npm\node_modules\expo-cli\node_modules\regenerator-runtime\runtime
.js:114:21)
at step (C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\node_m
odules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\node_modules
\babel-runtime\helpers\asyncToGenerator.js:35:14
at new Promise (<anonymous>)
at new F (C:\Users\shubhamt1\AppData\Roaming\npm\node_modules\expo-cli\node_
modules\core-js\library\modules\_export.js:36:28)
Please help on this. I am missing something ?
What you have to do basically is to update the expo client to 2.6.11, and then update the node.js to a version greater than 10.0 (10 or newer version) and install git. After that, run the command
expo init <app-name>
According to Expo docs,
You'll need to have Node.js (version 10 or newer) installed on your computer. Download the latest version of Node.js. Additionally, you'll need Git to create new projects with Expo CLI
See Getting Started-React Native for a comprehensive guide.
Downgrading to 2.11.6 doesn't work for me :
~/Projects/ReactNativeApp (master)
$ expo --version
2.11.6
~/Projects/ReactNativeApp (master)
$ expo init ReactNativeApp
[12:07:17] (0 , (_wordwrap || _load_wordwrap(...)).default)(...)(...).trimStart is not a function
[12:07:17] Set EXPO_DEBUG=true in your env to view the stack trace.
I have to downgrade to 2.11.3 in order to skip this error.
I have the same issue with 2.11.5 and 2.11.4.
Upgrading to node.js 10+ fixed this issue.
use lower version of expo,i think new version is still in beta.
This is a problem with nodejs version, you can install nvm and then update easly the node version, i updated to version 10.15 and it works:
Installing NVM at ubuntu

meteor run android- spawn ENOENT and gradle errors from Cordova

I am attempting to run a Meteor project on an Android device and/or emulator. When I run either meteor run --verbose android or meteor run --verbose android-device, I get errors related to Cordova not being able to find certain gradle files. Here's some output from my console:
sarah#sarah-ThinkPad-X220:~/simple-todos$ meteor run --verbose android
Getting installed version for platform android in Cordova project
Checking Cordova requirements for platform Android
[[[[[ ~/simple-todos ]]]]]
=> Started proxy.
=> Started MongoDB.
Local package version is up-to-date: autopublish#1.0.4
<... removed some other "Local package" messages here ...>
Preparing Cordova project from app bundle
Copying resources for mobile apps
Writing new config.xml
Preparing Cordova project for platform Android
Running Cordova app for platform Android with options --emulator
ANDROID_HOME=/home/sarah/Android/Sdk/ |
JAVA_HOME=/usr/lib/jvm/default-java
=> Started your app.
=> App running at: http://localhost:3000/
WARNING : no emulator specified, defaulting to nexus4
Waiting for emulator...oid Emulator |
emulator: UpdateChecker: skipped version check
BOOT COMPLETEpp on Android Emulator -
cp: no such file or directory: /home/sarah/Android/Sdk/tools/templates/gradle/wrapper/gradlew
chmod: File not found: /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/gradle/wrapper/gradle-wrapper.properties
sed: no such file or directory: /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/gradle/wrapper/gradle-wrapper.properties
Running: /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/gradlew cdvBuildDebug -b /home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/build.gradle -PcdvBuildArch=x86 -Dorg.gradle.daemon=true
events.js:72app on Android Emulator \
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)
=> Errors executing Cordova commands:
While running Cordova app for platform Android with options --emulator:
Error: Command failed:
/home/sarah/simple-todos/.meteor/local/cordova-build/platforms/android/cordova/run --emulator
at ChildProcess.exitCallback (/tools/utils/processes.js:137:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
ExitWithCode:1
Indeed, the files and directories it is trying to access are not there. $ANDROID_HOME/tools/template/gradle/wrapper does not have a directory gradlew
sarah#sarah-ThinkPad-X220:~/Android/Sdk/tools/templates/gradle/wrapper$ ls
gradle
Likewise, there are no files at all in my ~/simple-todos/.meteor/local/cordova-build/platforms/android/gradle/wrapper directory, so there is no gradle-wrapper.properties.
I'm also quite uncertain about the meaning of the spawn ENOENT error.
How can I fix this?
EDIT: I wanted to test that gradle worked at all on my machine, so I made an app in Android Studio and ran it on my phone-- worked fine. My Meteor project still doesn't run on Android, but I think this tells me that gradle is working (somewhere) on my computer.
EDIT: I searched for a gradlew directory on my computer and the only ones I found were in an android-studio, not in my $ANDROID_HOME(~\Android/Sdk). Not sure what to do with this info, but it seems relevant.
EDIT It occurred to me that the output of gradle -v might be useful:
$ gradle -v
------------------------------------------------------------
Gradle 2.5
------------------------------------------------------------
Build time: 2015-08-31 14:26:53 UTC
Build number: none
Revision: UNKNOWN
Groovy: 2.4.3
Ant: Apache Ant(TM) version 1.9.6 compiled on July 8 2015
JVM: 1.7.0_95 (Oracle Corporation 24.95-b01)
OS: Linux 4.2.0-23-generic amd64
Initial disclaimer: I'm not super familiar with the particular tools you are using on top of the android+gradle, but I'll try to help as best I can.
This is worth reading: https://docs.gradle.org/current/userguide/gradle_wrapper.html
Also, you probably want to get gradle setup on your system first, and double check that gradle home is set (*not always necessary, but depends on what other things like android studio, etc. pull in automagically): https://docs.gradle.org/current/userguide/installation.html
My guess is that the tooling you are using is trying to find the system gradle and/or gradlew it expects to have available within your project...and that it is getting mixed up.

Unable to create IONIC project

I am getting following error while creating new project whith ionicFramework, any one have idea how to resolve it.
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
C:\Users\...\AppData\Roaming\npm\node_modules\ionic\lib\ionic.js:256
if<res.statusCode !==200> {
TypeError: Cannot read property 'statusCode' of undefined
atRequest._callback(C:\Users\...\AppData\Roaming\npm\node_modules\ionic\lib\ionic.js:256
ic\lib\ionic.js:257:13)
at self.callback (C:\Users\...\AppData\Roaming\npm\node_modules\ionic\lib\ionic.js:256
ic\lib\ionic.js:129:22)
at Request.EventEmitter.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (C:\Users\...\AppData\Roaming\
npm\node_modules\ionic\node_modules\request\request.js:239:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at SocketPair.<anonymous>(tls.js:1384:19)
at SocketPair.emit (events.js:92:17)
at SocketPair.maybeInitFinished(tls.js:977:10)
Update your version of the ionic CLI tool first. Alternatively you could manually start the app.
Download the base app and unzip into your directory. https://github.com/driftyco/ionic-app-base
Download the blank template and merge files into the same directory. https://github.com/driftyco/ionic-starter-blank
Run bower install to make sure bower assets are up to date
Run npm install to install assets for gulp to build sass (optional if you don't use sass)
Thats just what the ionic start command does in a nutshell.
Check if you have 'tutorial' in your Ionic Starter templates :
ionic start --list
If It's not in the list, you must add it to the list by Updating your Ionic Framework:
Update Ionic CLI : sudo npm install -g ionic
Update Ionic Library : ionic lib update
Update Apache Cordova : sudo npm install -g cordova

Categories

Resources