Invalid podfile with new React Native project - javascript

I just created a new React Native project, and when I try and run pod install in the ios directory I get this error:
Invalid `Podfile` file: cannot load such file -- ./scripts/autolinking
I didn't start the project with Expo, but it looks like my Podfile has this line at the top:
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
Are there any known fixes? I'm not sure why Expo is being included in my project here.

Related

npx create-next-app will only ceate a package.json file and then fail

I have been trying to create a new nextjs app for a project but I keep getting this error.
I have tried several techniques to create a new nextjs app but the same error continues.
I don't know if it's from my PC configuration or something because; recently, even npx create-react-app started giving the same error on my PC
Here's the error
Creating a new Next.js app in C:\Users\<user>\Desktop\websites\nextjs-starter.
Using yarn.
Installing dependencies:
- react
- react-dom
- next
Usage Error: The nearest package directory (C:\Users\<user>\Desktop\websites\nextjs-starter) doesn't seem to be part of the project declared in C:\Users\<user>.
- If C:\Users\<user> isn't intended to be a project, remove any yarn.lock and/or package.json file there.
- If C:\Users\<user> is intended to be a project, it might be that you forgot to list Desktop/websites/nextjs-starter in its workspace configuration.
- Finally, if C:\Users\<user> is fine and you intend Desktop/websites/nextjs-starter to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.
$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
Aborting installation.
yarn add --exact --cwd C:\Users\<user>\Desktop\websites\nextjs-starter react react-dom next has failed.

I am implementing an electron application using electron packager. However, it gives an error that it could not find the index.js file

I have developed an application with react and electron and used typescript. My file directory is as follows. In my index.tsx file, there is the classic index.tsx file content from React. My app is running smoothly. I want to run my application on all platforms and I use electron packager for this, but it throws me an error like "The main entry point to your app was not found. Make sure "index.js" exists and does not get ignored by your ignore option"
I have faced same issue and solved by using below steps.
npm install #capacitor/core#1.5.3
npm install #capacitor/cli#1.5.3 --save-dev
npx cap init
Open angular.json file and change output dir by default to “www”.
"outputPath": "dist/smart-accounting-book",
ng build --prod
npx cap add electron
Go to file:
electron→ app → index.html and change href=”/” to href=”./”
electron→ index.js and make below changes to isDevMode, i.e const isDevMode = false;
npx cap open electron
That’s it.

react-native link does not find project.pbxproj file

I have a react-native project where I changed my project name in package.json due to eslint warnings. Now when I try to run react-native link to link any library, I'm getting the following error:
Scanning folders for symlinks in /Users/my-username/projects/myproject-folder/node_modules (20ms)
rnpm-install info Linking assets to ios project
rnpm-install ERR! Something went wrong while linking. Error: ENOENT: no such file or directory, open '/Users/my-user-name/projects/myproject-folder/ios/my-old-app-name.xcodeproj/project.pbxproj'
So it doesn't find the file project.pbxproj, as it is looking at it from the wrong folder.
What I have tried so far with failed outcomes:
react-native upgrade
react-native-rename
Deleted node_modules and run npm install again
Renamed app name to correct in index.ios.js for AppRegistry.registerComponent
Where does react-native link look for the file project.pbxproj? If I find that location, I could rewrite it to the new correct one. I have no xcode, and currently only android version. I (still) have the separate index files for both versions, even I heard that after some react-native upgrade they should have been merged...
Was able to solve this by deleting the other project folders in the ios -folder. Apparently react-native just loops through every project there it finds, and picks the first one.
I stumbled this problem just today. Here are the steps I made to make it work again
Delete the ios folder
react-native eject // this will re generate the ios folder
react-native-link
I also did gradle clean before the earlier steps but I think its unnecessary.

Invalid sdkVersion while running react native project

I'm stuck on the initial part of react native app building. I'm using create-react-native-app pkg to create the project and When I run the android version app through "yarn run android" command I get the error below:
Error: Invalid sdkVersion. Valid options are 10.0.0, 11.0.0, 12.0.0, 13.0.0, 14.0.0, 15.0.0, 16.0.0, 17.0.0, 18.0.0, 19.0.0, 20.0.0, 21.0.0, 22.0.0, 23.0.0, 24.0.0, 25.0.0, 7.0.0, 8.0.0, 9.0.0
It's a windows machine. Node v10.0.0, npm v5.6.0, Java 1.8 & android studio is already installed and working I added variety of APIs through android studio.. currently I have 17-23-24-26 installed in Sdk platforms.
And I get the following error on real android device:
uncaught Error: console.error: React Native version mismatch.
Javascript version: 0.53.0
Native version: 0.52.0
Make sure that you have rebuilt the native code. If the problem persists try clearing the Watchman and packager caches with 'watchman watch-del-all && react-native start --reset-cache.
I didn't find solution ...
I solve this issue by installation of Expo XDE window app.
the problem was missing schema-27.0.0.json file in directory:
C:\Users\{user}\AppData\Local\Expo
download Expo XDE
schema.json version is depend on react native npm version that you installed.
documents here
open your build.gradle file ( located in YOUR_PROJECT/android/app/build.gradle ) and validate your compileSdkVersion
EDIT
if you are using expo check sdkVersion in your app.json file and be sure it is same as one in package.json file
In the file app.json put "sdkVersion": "36.0.0",
{
"expo": {
"name": "name-app",
"slug": "name-app",
"sdkVersion": "36.0.0",
...

React-Native module is being looked for in an invalid directory

I am helping with a project. The code is written mainly in TypeScript. We use babel to translate ES6->ES5. The front-end is developed with react-native. Recently, after updating babel, packages became "missing." I manually locally installed each package and one-by-one got the project to compile up to the below error, shown sometime after packer starts.
+ react-native bundle --entry-file index.ios.js --platform ios --dev true --bundle-output /Users/shmukler/Library/Developer/Xcode/DerivedData/MyApp-gjqyntaykupdmhaecjypkdppuznf/Build/Products/Debug-iphonesimulator/MyApp.app/main.jsbundle --assets-dest /Users/shmukler/Library/Developer/Xcode/DerivedData/MyApp-gjqyntaykupdmhaecjypkdppuznf/Build/Products/Debug-iphonesimulator/MyApp.app
uncaught error Error: UnableToResolveError: Unable to resolve module LinkedStateMixin from /Users/shmukler/Projects/myproject/myapp-ios/node_modules/react-native/Libraries/react-native/react-native.js: Invalid directory /Users/node_modules/LinkedStateMixin
I installed LinkedStateMinin with npm install react-addons-pure-render-mixin - much like all other packages. Why is it looking for it at
/Users/node_modules/LinkedStateMixin ? How can I change that? Where are those paths specified? Could I manually hack the path just to get the app to build, as a temporary way to move forward?
Thank you

Categories