cannot build react native project after react-native-git-upgrade - react-native

I tried to upgrade react-native from 0.49.3 to 0.55.3. I followed the official [guide][1] and when I ran react-native-git-upgrade, I got the following log:
git-upgrade info Check for updates
git-upgrade info Using yarn 1.5.1
git-upgrade info Read package.json files
git-upgrade info Check declared version
git-upgrade info Check matching versions
git-upgrade info Check React peer dependency
git-upgrade info Check that Git is installed
git-upgrade info Get information from NPM registry
git-upgrade info Upgrading to React Native 0.55.3, React 16.3.1
git-upgrade info Setup temporary working directory
git-upgrade info Configure Git environment
git-upgrade info Init Git repository
git-upgrade info Add all files to commit
git-upgrade info Commit current project sources
git-upgrade info Create a tag before updating sources
git-upgrade info Generate old version template
git-upgrade info Add updated files to commit
git-upgrade info Commit old version template
git-upgrade info Install the new version
warning " > react-native-maps#0.20.1" has incorrect peer dependency "react#16.0.0".
warning " > react-native-maps#0.20.1" has incorrect peer dependency "react-native#0.51.0".
warning " > #storybook/addon-storyshots#3.2.13" has unmet peer dependency "#storybook/addons#^3.2.13".
warning " > #storybook/addon-storyshots#3.2.13" has unmet peer dependency "#storybook/channels#^3.2.13".
warning " > #storybook/addon-storyshots#3.2.13" has unmet peer dependency "#storybook/react#^3.2.13".
warning " > #storybook/addon-storyshots#3.2.13" has unmet peer dependency "babel-core#^6.26.0".
warning "#storybook/react-native > #storybook/ui > react-icons#2.2.7" has incorrect peer dependency "react-dom#^0.14.0 || ^15.0.0 || ^16.0.0".
warning "#storybook/react-native > #storybook/ui > react-komposer#2.0.0" has incorrect peer dependency "react#^0.14.7 || ^15.0.0".
warning "#storybook/react-native > #storybook/ui > react-modal#2.4.1" has incorrect peer dependency "react#^0.14.0 || ^15.0.0".
warning "#storybook/react-native > #storybook/ui > react-modal#2.4.1" has incorrect peer dependency "react-dom#^0.14.0 || ^15.0.0".
warning "#storybook/react-native > #storybook/ui > react-treebeard#2.0.3" has incorrect peer dependency "react#^15.5.4".
warning "#storybook/react-native > #storybook/ui > react-treebeard#2.0.3" has incorrect peer dependency "react-dom#^15.5.4".
warning "#storybook/react-native > #storybook/ui > mantra-core > react-komposer#1.13.1" has incorrect peer dependency "react#^0.14.3 || ^15.0.0".
warning "#storybook/react-native > #storybook/ui > mantra-core > react-simple-di#1.2.0" has incorrect peer dependency "react#^0.14.0 || ^15.0.0".
warning "#storybook/react-native > #storybook/ui > react-komposer > react-stubber#1.0.0" has incorrect peer dependency "react#^0.14.7 || ^15.0.0".
warning "#storybook/react-native > #storybook/ui > react-treebeard > velocity-react#1.3.3" has incorrect peer dependency "react-dom#^15.3.0 || ^16.0.0".
warning "#storybook/react-native > #storybook/ui > react-treebeard > velocity-react > react-transition-group#1.2.1" has incorrect peer dependency "react-dom#^15.0.0 || ^16.0.0".
warning " > babel-jest#21.2.0" has unmet peer dependency "babel-core#^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0".
warning " > enzyme#2.9.1" has incorrect peer dependency "react#0.13.x || 0.14.x || ^15.0.0-0 || 15.x".
warning " > react-addons-test-utils#15.4.2" has incorrect peer dependency "react-dom#^15.4.2".
warning "react-native > eslint-plugin-react-native#3.2.1" has unmet peer dependency "eslint#^3.17.0 || ^4.0.0".
git-upgrade info Generate new version template
git-upgrade info Add updated files to commit
git-upgrade info Commit new version template
git-upgrade info Generate the patch between the 2 versions
git-upgrade info Save the patch in temp directory
git-upgrade info Reset the 2 temporary commits
git-upgrade info Apply the patch
error: patch failed: .gitignore:51
Falling back to three-way merge...
Applied patch to '.gitignore' with conflicts.
error: ios/MyApp.xcodeproj/project.pbxproj: does not exist in index
error: ios/MyApp/AppDelegate.h: does not exist in index
error: ios/MyApp/AppDelegate.m: does not exist in index
error: ios/MyApp/main.m: does not exist in index
error: ios/MyAppTests/MyAppTests.m: does not exist in index
git-upgrade WARN The upgrade process succeeded but there might be conflicts to be resolved. See above for the list of files that have merge conflicts.
git-upgrade info Upgrade done
Notice these lines:
error: ios/MyApp.xcodeproj/project.pbxproj: does not exist in index
error: ios/MyApp/AppDelegate.h: does not exist in index
error: ios/MyApp/AppDelegate.m: does not exist in index
error: ios/MyApp/main.m: does not exist in index
error: ios/MyAppTests/MyAppTests.m: does not exist in index
These files are now all missing. Despite the message saying it succeeded, trying react-native -v yields
react-native-cli: 2.0.1
react-native: 0.55.3
And now the MyApp/ios/ directory is missing almost all of it's original files. If I even try react-native run-ios, I get xcodebuild: error: Scheme MyApp is not currently configured for the build action. Any suggestions would be incredibly helpful.

Figured it out. For those of you with this problem, all you need to do is delete your android/ios folder and use react-native eject which will regenerate the files necessary to rebuild your react-native project. This should be in the official react native upgrading guide IMO.

Related

kotlin/js cant run develpment run

i can't run a freshly created kotlin react project when i try to i get see below error en cant use it
> Task :kotlinNpmInstall
warning workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > untitled1 > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > untitled1 > webpack-dev-server > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom#5.3.0" has unmet peer dependency "react#>=15".
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-styled-js-ir > styled-components#5.3.3" has unmet peer dependency "react#>= 16.8.0".
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-styled-js-ir > styled-components#5.3.3" has unmet peer dependency "react-dom#>= 16.8.0".
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-styled-js-ir > styled-components#5.3.3" has unmet peer dependency "react-is#>= 16.8.0".
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-react-redux-js-ir > react-redux#7.2.6" has unmet peer dependency "react#^16.8.3 || ^17".
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-react-dom-js-ir > react-dom#17.0.2" has unmet peer dependency "react#17.0.2".
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom > react-router#5.2.1" has unmet peer dependency "react#>=15".
warning "workspace-aggregator-c22f0aa7-62f6-4cd1-b73e-254168ec2f14 > kotlin-wrappers-kotlin-react-router-dom-js-ir > react-router-dom > react-router > mini-create-react-context#0.4.1" has unmet peer dependency "react#^0.14.0 || ^15.0.0 || ^16.0.0 || ^17.0.0".
error An unexpected error occurred: "EISDIR: illegal operation on a directory, symlink 'D:\\projects\\kotlin\\untitled1\\build\\js\\packages_imported\\kotlin-test-js-runner\\1.5.31' -> 'D:\\projects\\kotlin\\untitled1\\build\\js\\node_modules\\kotlin-test-js-runner'".
FAILURE: Build failed with an exception.

yarn install warning "xxx > xxx > xxx" has incorrect peer dependency "xxx"

When I run yarn install, the command line output is as follows:
warning "#umijs/preset-react > #umijs/plugin-dva > dva#2.6.0-beta.22" has incorrect peer dependency "react#^16.8.4".
warning "#umijs/preset-react > #umijs/plugin-dva > dva#2.6.0-beta.22" has incorrect peer dependency "react-dom#^16.8.4".
warning "#umijs/preset-react > #umijs/plugin-dva > dva-loading#3.0.22" has unmet peer dependency "dva-core#^1.1.0 | ^1.5.0-0 | ^1.6.0-0".
warning "#umijs/preset-react > #umijs/plugin-locale > react-intl#3.12.1" has incorrect peer dependency "react#^16.3.0".
warning "#umijs/preset-react > #umijs/plugin-request > #ahooksjs/use-request#2.8.3" has incorrect peer dependency "react#^16.8.6".
My yarn version is 1.22.10.
This mean's there is some error with the dependencies warned about, but this shouldn't stop yarn from moving forward, to fix this you would have to upgrade yarn, running the command below you upgrade yarn:
yarn upgrade --latest
When yarn is fully updated, reinstall the dependencies using the same yarn install.

ENOSYS: function not implemented

I recently install next js use to npm in raspi 4 with the raspbian operating system. Every time when I install react js, next js, and gatsby show me the same error.
At this time I install nextjs use yarn. also, I use npm and npx to show the same error. so I started to find a solution then somebody told me to use sudo so I use sudo but doesn't work
sudo yarn create next-app
check my code error output
pi#raspberrypi:/media/pi/8243-BE00/next $ sudo yarn create next-app
yarn create v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-next-app#10.0.5" with binaries:
- create-next-app
✔ What is your project named? … myapp
Creating a new Next.js app in /media/pi/8243-BE00/next/myapp.
Installing react, react-dom, and next using yarn...
yarn add v1.22.10
info No lockfile found.
[1/4] Resolving packages...
warning next > chokidar > fsevents#2.1.3: "Please update to latest v2.3 or v2.2"
warning next > webpack > watchpack > watchpack-chokidar2 > chokidar#2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning next > webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning next > resolve-url-loader > rework > css > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning next > resolve-url-loader > rework > css > source-map-resolve > urix#0.1.0: Please see https://github.com/lydell/urix#deprecated
warning next > resolve-url-loader > rework > css > source-map-resolve > resolve-url#0.2.1: https://github.com/lydell/resolve-url#deprecated
[2/4] Fetching packages...
info fsevents#2.1.3: The platform "linux" is incompatible with this module.
info "fsevents#2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.3.1: The platform "linux" is incompatible with this module.
info "fsevents#2.3.1" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
error An unexpected error occurred: "ENOSYS: function not implemented, symlink '../../../../terser/bin/terser' -> '/media/pi/8243-BE00/next/myapp/node_modules/#ampproject/toolbox-optimizer/node_modules/.bin/terser'".
info If you think this is a bug, please open a bug report with the information provided in "/media/pi/8243-BE00/next/myapp/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom next --cwd /media/pi/8243-BE00/next/myapp has failed.
Done in 293.09s.
pi#raspberrypi:/media/pi/8243-BE00/next $
You can try this next:
Remove yarn.lock.
Remove node_modules.
Use the --ignore-optional FLAG (yarn --ignore-optional); these don’t install optional dependencies.
The fsevents package is for macOS only; you don't need it in Linux.
If any of that works you can remove ignore and see if .yarnclean works.
Based on the log, looks like script is not able to create symbolic link
"ENOSYS: function not implemented, symlink '../../../../terser/bin/terser' -> '/media/pi/8243-BE00/next/myapp/node_modules/#ampproject/toolbox-optimizer/node_modules/.bin/terser'".
What is the file system you are using? I know exFAT and FAT32 don't support symbolic link.
Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/filesystem-functionality-comparison

react-native init... cannot find module ...\template.config

Hi i have problem with initialize new react-native project. I have already check some similar problems from stackoverflow, but i didn't find anything that helps.
When i try to init new project using "react-native init test --verbose" command (--verbose for more details)
i get an error:
debug Installing template from react-native#latest
yarn add v1.16.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#2.0.6: The platform "win32" is incompatible with this module.
info "fsevents#2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.9: The platform "win32" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-router-scroll-top#0.1.1" has incorrect peer dependency "react-router-dom#^4.2.2".
warning "react-scripts > #typescript-eslint/eslint-plugin#1.6.0" has unmet peer dependency "typescript#*".
warning "react-scripts > #typescript-eslint/parser#1.6.0" has unmet peer dependency "typescript#*".
warning " > eslint-plugin-react-hooks#1.6.1" has unmet peer dependency "eslint#^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
warning "react-scripts > #typescript-eslint/eslint-plugin > #typescript-eslint/typescript-estree#1.6.0" has unmet peer dependency "typescript#*".
warning "react-scripts > #typescript-eslint/eslint-plugin > tsutils#3.17.1" has unmet peer dependency "typescript#>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning " > eslint-config-airbnb#17.1.1" has unmet peer dependency "eslint#^4.19.1 || ^5.3.0".
warning "eslint-config-airbnb > eslint-config-airbnb-base#13.2.0" has unmet peer dependency "eslint#^4.19.1 || ^5.3.0".
warning " > eslint-config-react-app#3.0.8" has unmet peer dependency "babel-eslint#9.x".
warning " > eslint-config-react-app#3.0.8" has unmet peer dependency "eslint#5.x".
warning " > eslint-config-react-app#3.0.8" has incorrect peer dependency "eslint-plugin-flowtype#2.x".
warning " > eslint-plugin-flowtype#3.13.0" has unmet peer dependency "eslint#>=5.0.0".
warning " > eslint-plugin-import#2.18.2" has unmet peer dependency "eslint#2.x - 6.x".
warning " > eslint-plugin-jsx-a11y#6.2.3" has unmet peer dependency "eslint#^3 || ^4 || ^5 || ^6".
warning " > eslint-plugin-react#7.14.3" has unmet peer dependency "eslint#^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0".
warning "react-native > metro-react-native-babel-transformer#0.54.1" has unmet peer dependency "#babel/core#*".
[4/4] Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ react-native#0.60.4
info All dependencies
└─ react-native#0.60.4
Done in 13.10s.
debug Getting config from C:\Users\Lukasz\AppData\Local\Temp\rncli-init-template-8Gdikl\node_modules\react-native\template.config.js
error Error: Cannot find module 'C:\Users\Lukasz\AppData\Local\Temp\rncli-init-template-8Gdikl\node_modules\react-native\template.config'
Require stack:
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\commands\init\template.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\commands\init\init.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\commands\init\index.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\commands\index.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\cliEntry.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\index.js
- C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\bin.js
error EBUSY: resource busy or locked, rmdir 'C:\xampp\htdocs\projekty\19-08-sie\test'
Error: EBUSY: resource busy or locked, rmdir 'C:\xampp\htdocs\projekty\19-08-sie\test'
at Object.rmdirSync (fs.js:693:3)
at rmdirSync (C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\fs-extra\lib\remove\rimraf.js:276:13)
at Object.rimrafSync [as removeSync] (C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\fs-extra\lib\remove\rimraf.js:252:7)
at Object.initialize [as func] (C:\Users\Lukasz\AppData\Local\Yarn\Data\global\node_modules\#react-native-community\cli\build\commands\init\init.js:292:26)
at processTicksAndRejections (internal/process/task_queues.js:85:5)
I have tried:
- clear npm cache
- reinstall react-native
I had the same error. Install the react-native-cli for works.
yarn global add react-native-cli
or
npm i -g react-native-cli
The problem is the location of server xampp. All first level folders under C:// need Admin permissions to update or remove, i recomended install xampp on another place, or run you console with admin privileged.

How to fix sentry-related yarn error: ENOENT: no such file or directory, scandir '.../src/native/node_modules/#sentry'

I'm attempting to install new packages in my react-native project via yarn but am caught up by the above error message.
I've installed react-native-sentry via npm rather than yarn. Any attempt to uninstall and unlink from the rest of the project doesn't help. No other suggestions posted (https://github.com/getsentry/sentry-electron/issues/94) have gotten me past this first error. Any subsequent attempt to build in Xcode after this initial yarn error gives me tons more errors.
My (truncated) src/native/package.json:
{
"name": "native",
.
.
.
"workspaces": {
"nohoist": ["#sentry", "#sentry/**"]
},
.
.
.
},
"dependencies": {
.
.
.
"react-native-sentry": "^0.39.0",
The initial error:
$ yarn
yarn install v1.16.0
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning " > [XXXX].shared-components#1.0.0" has unmet peer dependency "react#^16.5.0".
warning "workspace-aggregator-ad0ee18a-71f6-4b7e-ae5b-7d9c0089e4da > hydrated-oauth-redux > #callstack/async-storage#1.1.0" has unmet peer dependency "react-native#^0.38".
warning "workspace-aggregator-ad0ee18a-71f6-4b7e-ae5b-7d9c0089e4da > hydrated-oauth-redux > babel-jest#22.4.4" has unmet peer dependency "babel-core#^6.0.0 || ^7.0.0-0".
warning "workspace-aggregator-ad0ee18a-71f6-4b7e-ae5b-7d9c0089e4da > native > enzyme-adapter-react-16#1.11.2" has unmet peer dependency "react-dom#^16.0.0-0".
error An unexpected error occurred: "ENOENT: no such file or directory, scandir '[XXXX]/src/native/node_modules/#sentry'".
info If you think this is a bug, please open a bug report with the information provided in "[XXXX]/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
This causes a subsequent error in Xcode when attempting to run the app in the simulator, forcing me to restore my entire project to a prior commit.
/Users/[XXXX]/Library/Developer/Xcode/DerivedData/[XXXX]/Build/Intermediates.noindex/[XXXX].build/Debug-iphonesimulator/[XXXX].build/Script-00DD1BFF1BD5951E006B06BC.sh: line 5: export: `/[XXXX]/src/native/ios/.."': not a valid identifier
/Users/[XXXX]/Library/Developer/Xcode/DerivedData/[XXXX]/Build/Intermediates.noindex/[XXXX].build/Debug-iphonesimulator/[XXXX].build/Script-00DD1BFF1BD5951E006B06BC.sh: line 7: ../node_modules/#sentry/cli/bin/sentry-cli: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
Many others have faced a similar error, yet I don't believe it's the root of my issue. None of their solutions have helped.
I have tried uninstalling sentry and completely wiping every mention from the project, reverting to previous commits, reinstalling nvm and yarn and react-native-sentry through multiple package managers, but no luck.