Error executing "react-native link realm" - react-native

I am trying to install realm to a react-native project (on Windows). I executed the following commands.
npm install --save realm
react-native link realm
I got the following error message - where <Project-Folder> is my project folder.
error EPERM: operation not permitted, scandir '<Project-Folder>/android/app/build/intermediates/signing_config/debug/out/signing-config.json'

The problem was resolved by executing the following command in Admin mode, i.e. you need to open cmd.exe as Administrator.
react-native link realm

Related

Execution failed for task ':react-native-location:compileDebugJavaWithJavac'

I upgraded all packages I am using on my app and then I decided to delete the node_module folder as well as package-lock.json. I then ran npm install and it installed everything but when I try run npx react-native run-android it fails with the following error:
> Execution failed for task ':react-native-location:compileDebugJavaWithJavac'.
I must state that when I installed all packages with npm install I had to run it with --force flag otherwise it would fail. Not sure if this has anything to do with the current error but just wanted to mention it.

Error when trying to do 'expo build:android'

In the Terminal I get the following error after running the expo build:android command:
Error: Can't find react-native in package.json dependencies
Error: react-native is not installed. Please run `npm install` or `yarn` in your project directory.
There is an error with your project. See above logs for information.Error: There is an error with your project. See above logs for information.
Terminal error picture
I have already tried to update npm version, npm install, and I also tried npm install -g eas-cli
Are there certain steps anyone thinks I should do?
Follow below guide
Delete node_modules folder in root folder
npm install (If you are using yarn use yarn install)

error while running "sanity init" command in a Next.js project, failed at "Resolving dependencies"

I tried to run sanity init in a Next.js project and got the following error:
Error message image:
Try to use npm install or yarn install.

expo install react-native-svg "error Running this command will add the dependency to the workspace root rather than the workspace itself..."

I'm using Expo CLI. I want to use SVG in React Native. So, I follow an instruction from here https://github.com/react-native-svg/react-native-svg. But when I installed expo install react-native-svg I received the following error:
expo install react-native-svg
> yarn add react-native-svg
yarn add v1.22.11
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
yarnpkg exited with non-zero code: 1
Error: yarnpkg exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\spawn-async\src\spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:482:26)
at ChildProcess.emit (events.js:375:28)
at ChildProcess.cp.emit (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1055:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
...
at Object.spawnAsync [as default] (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\spawn-async\src\spawnAsync.ts:26:19)
at YarnPackageManager._runAsync (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\package-manager\src\NodePackageManagers.ts:309:31)
at YarnPackageManager.addAsync (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\package-manager\src\NodePackageManagers.ts:258:16)
at actionAsync (C:\Users\85620\AppData\Roaming\npm\node_modules\expo-cli\src\commands\installAsync.ts:55:12)
Screenshot1
And when I tried this command yarn add react-native-svg, I received this error
yarn add react-native-svg
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Screenshot2
Any suggestion? I'm new to Expo and React Native.
Maybe you should use expo command
expo install react-native-svg
According to this topic why does yarn warn when adding a dependency to the root workspaces package.json, now I can install it with the following command.
yarn workspace mobile-app add react-native-svg

How to fix error in "Copying template" when making project?

I'm generating a new project using React-Native in Command Prompt but I get an error when I use the following command:
react-native init Style
This is the result I get:
√ Downloading template
× Copying template
error Error: Cannot find module 'C:\Users\User\AppData\Local\Temp\rncli-init-template-srEvW0\node_modules\react-native\template.config'
error EBUSY: resource busy or locked, rmdir 'D:\FUSI\React Native\Style'. Run CLI with --verbose flag for more details.
Error: EBUSY: resource busy or locked, rmdir 'D:\FUSI\React Native\Style'
at Object.rmdirSync (fs.js:684:3)
at rmdirSync (D:\FUSI\React Native\node_modules\fs-extra\lib\remove\rimraf.js:276:13)
at Object.rimrafSync [as removeSync] (D:\FUSI\React Native\node_modules\fs-extra\lib\remove\rimraf.js:252:7)
at Object.initialize [as func] (D:\FUSI\React Native\node_modules\react-native\node_modules#react-native-community\cli\build\commands\init\init.js:295:26)
at process._tickCallback (internal/process/next_tick.js:68:7)
How can I fix this error?
Mustafa AK had it right. What worked for me is adding the --npm flag at the end of the command.
I followed the tutorial exactly how it was laid out on the React website and was running into the same error. For whatever reason, if you have yarn and npm installed the command to create a new project will not work. So you have to add the --npm flag to get it to only use npm and this will work.
npx react-native init AwesomeProject --npm
This Same error comes with me. But I solved by following ways...
First, uninstall the node from your system and download the latest version of node and install it.
2.after installation of the latest version of node you need to write the command in your command prompt
npm install -g react-native-cli
Now go to your project directory
cd your-react-native-project directory
now create your react-native project
react-native init your-project-name.
https://stackoverflow.com/a/71725307/16114216
Be sure uninstall global react-native/cli as described react-native tutorials
Try to use --npm end of init command if you had yarn and npm both.
npx react-native init MyApp --template react-native-template-typescript --npm
Note: If you have both yarn and npm installed on your machine, React Native CLI will always try to use yarn, so even if you use npx utility, only react-native executable will be installed using npm and the rest of the work will be delegated to yarn. You can force usage of npm adding --npm flag to the command.