I'm trying to run a react native app in expo, and after creating a blank app with expo init, when I cd into my project and do expo start, I get the following error:
events.js:282
throw er; // Unhandled 'error' event
^
Error: unable to resolve root /Users/myusername/Documents/native-app-name: failed to opendir(/Users/myusername/Documents/native-app-name): Operation not permitted
at BunserBuf.<anonymous> (/Users/myusername/Documents/native-app-name/node_modules/fb-watchman/index.js:95:23)
at BunserBuf.emit (events.js:305:20)
at BunserBuf.process (/Users/myusername/Documents/native-app-name/node_modules/bser/index.js:292:10)
at /Users/myusername/Documents/native-app-name/node_modules/bser/index.js:247:12
at processTicksAndRejections (internal/process/task_queues.js:79:11)
Emitted 'error' event on WatchmanWatcher instance at:
at Client.<anonymous> (/Users/myusername/Documents/native-app-name/node_modules/jest-haste-map/build/lib/WatchmanWatcher.js:130:10)
at Client.emit (events.js:305:20)
at BunserBuf.<anonymous> (/Users/myusername/Documents/native-app-name/node_modules/fb-watchman/index.js:107:12)
at BunserBuf.emit (events.js:305:20)
at /Users/myusername/Documents/native-app-name/node_modules/bser/index.js:249:12
at processTicksAndRejections (internal/process/task_queues.js:79:11) {
watchmanResponse: {
version: '4.7.0',
error: 'unable to resolve root /Users/myusername/Documents/native-app-name: failed to opendir(/Users/myusername/Documents/native-app-name): Operation not permitted'
}
}
Why might this be?
Try to move your project folder to a different place on your local. I just tried and worked for me.
Related
I am using react-native Expo to build an app and I am trying to use tensorflow.
I tested the code in another (not react-native Expo) project and it worked great!
Unfortunately, in my Expo project it is not working.
The code is:
const threshold = 0.9;
const labelsToInclude = ['identity_attack', 'insult', 'threat'];
toxicity.load(threshold, labelsToInclude).then(model => {
model.classify(['you suck']).then(predictions => {
console.log(JSON.stringify(predictions))
});
});
The code is from: https://medium.com/tensorflow/text-classification-using-tensorflow-js-an-example-of-detecting-offensive-language-in-browser-e2b94e3565ce
I am getting this error:
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:592:3)
at tryReadSync (fs.js:366:20)
at Object.readFileSync (fs.js:403:19)
at UnableToResolveError.buildCodeFrameMessage (C:\Users\user\OneDrive\Desktop\n\KidGuard\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:347:17)
at new UnableToResolveError (C:\Users\user\OneDrive\Desktop\n\KidGuard\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:333:35)
at ModuleResolver.resolveDependency (C:\Users\user\OneDrive\Desktop\n\KidGuard\node_modules\metro\src\node-haste\DependencyGraph\ModuleResolution.js:211:15)
at DependencyGraph.resolveDependency (C:\Users\user\OneDrive\Desktop\n\KidGuard\node_modules\metro\src\node-haste\DependencyGraph.js:413:43)
at C:\Users\user\OneDrive\Desktop\n\KidGuard\node_modules\metro\src\lib\transformHelpers.js:317:42
at C:\Users\user\OneDrive\Desktop\n\KidGuard\node_modules\metro\src\Server.js:1471:14
at Generator.next (<anonymous>)
right after the error I get this warning:
[Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'environment_1.env().platform.fetch')]
Would love some help!
I'm trying to add the OneSignal SDK to my ReactNative project managed by Expo SDK, by following the guide here:
Expo One Signal
here is my plugin setup in App.js
export default function App() {
useEffect(() => {
///Other things
OneSignal.setAppId(Constants.manifest.extra.oneSignalAppId);
}, []);
unfortunately it doesn't work, first I was getting:
Invariant Violation: Native module cannot be null.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/#react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-runtime/src/polyfills/require.js:204:6 in guardedLoadModule
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:263808:3 in global code
Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/#react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
Then, after opening an issue in GitHub the author suggested my to install:
yarn add react-native-onesignal
Here is the Issue on Github.Then I started getting:
iOS Bundling failed 3417ms
Unable to resolve module fs from /Users/giulioserra/Documents/App/CTS/node_modules/onesignal-expo-plugin/build/onesignal/withOneSignalIos.js: fs could not be found within the project or in these directories:
node_modules
If you are sure the module exists, try these steps:
1. Clear watchman watches: watchman watch-del-all
2. Delete node_modules and run yarn install
3. Reset Metro's cache: yarn start --reset-cache
4. Remove the cache: rm -rf /tmp/metro-*
29 | exports.xcodeProjectAddNse = exports.withOneSignalIos = void 0;
30 | const config_plugins_1 = require("#expo/config-plugins");
> 31 | const fs = __importStar(require("fs"));
I cleared the cache but nothing, It seems so strange since fs package should be included in every node release as far as I know, and suggestions?
After I create a Vue3 project with the Vue cli tool, my terminal crashes and gives the following error:
๐ Starting GUI...
๐ Ready on http://localhost:8000
node:events:368
throw er; // Unhandled 'error' event
^
Error: ENOENT: no such file or directory, scandir '/Users/xxxx/Desktop/personal/vuetest/node_modules/#vue/cli-service/locales'
at Object.readdirSync (node:fs:1390:3)
at exports.readdir (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/sync/fs.js:18:20)
at Object.safeCall [as safe] (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/call.js:24:8)
at DirectoryReader.readNextDirectory (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/directory-reader.js:78:10)
at Readable.DirectoryReader.stream._read (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/directory-reader.js:57:18)
at Readable.read (node:internal/streams/readable:496:27)
at readdirSync (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/sync/index.js:27:21)
at Function.readdirSyncStat (/usr/local/lib/node_modules/#vue/cli/node_modules/#mrmlnc/readdir-enhanced/lib/index.js:34:10)
at ReaderSync.dynamicApi (/usr/local/lib/node_modules/#vue/cli/node_modules/fast-glob/out/providers/reader-sync.js:64:24)
at ReaderSync.api (/usr/local/lib/node_modules/#vue/cli/node_modules/fast-glob/out/providers/reader-sync.js:56:25)
Emitted 'error' event on Readable instance at:
at emitErrorNT (node:internal/streams/destroy:164:8)
at emitErrorCloseNT (node:internal/streams/destroy:129:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: '/Users/xxxx/Desktop/personal/vuetest/node_modules/#vue/cli-service/locales'
}
Node.js v17.0.1
I cannot start the cli again until I delete the project folder. What is the problem here ?
My React Native (0.66.3) app today pops up an error with a stable code which hasn't had any change for quite some time. It is on macOS Big Sur. Here is the error:
ERROR TypeError: undefined is not a function, js engine: hermes
Error: ENOENT: no such file or directory, open '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
at Object.openSync (fs.js:498:3)
at Object.readFileSync (fs.js:394:35)
at getCodeFrame (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:919:18)
at Server._symbolicate (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:992:22)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Server._processRequest (/Users/macair/Documents/code/js/xyz_app5/node_modules/metro/src/Server.js:403:7) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/Users/macair/Documents/code/js/xyz_app5/http:/localhost:8081/index.bundle?platform=ios&dev=true&minify=false&modulesOnly=false&runModule=true&app=org.reactjs.native.example.xyz-app5'
}
Here is the error displayed on IOS simulator:
The error seems related to metro in React Native.
Reinstall node_modules
rm -rf node_modules
Clean your cache
yarn cache clean (or npm cache clean โforce)
So, i tried to deploy my Express.Js app to my vps, but I get some error that refined to Error: getaddrinfo EAI_AGAIN undefined. The weird part is, it is doing just fine if I run this app on my localhost. Any body knows how to resolve this issue?
Here are the error log that I get.
events.js:187
throw er; // Unhandled 'error' event
^
Error: getaddrinfo EAI_AGAIN undefined
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
Emitted 'error' event on Client instance at:
at Backoff.<anonymous> (/home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1228:12)
at Backoff.emit (events.js:210:5)
at Backoff.backoff (/home/user/deploy-folder/app-api/node_modules/ldapjs/node_modules/backoff/lib/backoff.js:41:14)
at /home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1214:15
at f (/home/user/deploy-folder/app-api/node_modules/ldapjs/node_modules/once/once.js:25:25)
at Socket.onResult (/home/user/deploy-folder/app-api/node_modules/ldapjs/lib/client/client.js:1016:7)
at Object.onceWrapper (events.js:300:26)
at Socket.emit (events.js:210:5)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) {
errno: 'EAI_AGAIN',
code: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'undefined'
I assume that by now you discovered the error, but in this particular case it seems that the variable you are using to setup ldap is not stated or resolves to undefined.
The proper way to do it according to the documentation is this:
var ldap = require('ldapjs');
var client = ldap.createClient({
url: 'ldap://127.0.0.1:1389'
});