react native init failed - react-native

whenever I create a new project then it throws the following Error. I did update any settings. everything was working fine before yesterday. Here is my issue.
[1/4] Resolving packages...
error Couldn't find package **"#typescript-eslint/parser#^4.22.1"** required by **"#react-native-community/eslint-config"** on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
E:\example\project\node_modules\execa\index.js:174
err = new Error(`Command failed: ${joinedCmd}${output}`);
^
Error: Command failed: yarn add -D #babel/core #babel/runtime #react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer#17.0.1
at makeError (E:\example\project\node_modules\execa\index.js:174:9)
at E:\example\project\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async generateProject (E:\example\project\node_modules\#react-native-community\cli\build\commands\init\initCompat.js:128:3)
at async Object.initCompat (E:\example\project\node_modules\#react-native-community\cli\build\commands\init\initCompat.js:105:3) {
code: 1,
stdout: null,
stderr: null,
failed: true,
signal: null,
cmd: 'yarn add -D #babel/core #babel/runtime #react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer#17.0.1',
timedOut: false,
killed: false
}
I did all remove a node, update node, removed react-native-CLI, and update it and it was fixed for some time. but I was unable to install any package.
it's now day 2 and I am stuck here.

before running react-native init try running npm install #typescript-eslint/parser#^4.22.1 I hope it resolves the issue.
if the issue persists try clearing cache with:
npm cache clean --force

Finally after search for a long time. I found a solution. just go to the network setting and turn off automatic proxy setting detection.

Related

React Native Error create new project ' Copying template '

when I'm try create new react native project
on macos Ventura 13.2
✔ Downloading template
✖ Copying template
error Error: Couldn't find the "/var/folders/mn/m8xhgjss2cj0jf5svmxg_2vm0000gn/T/rncli-init-template-VUPUIq/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid. Read more: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template.
Error: Error: Couldn't find the "/var/folders/mn/m8xhgjss2cj0jf5svmxg_2vm0000gn/T/rncli-init-template-VUPUIq/node_modules/react-native/template.config.js file inside "react-native" template. Please make sure the template is valid. Read more: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template
at createFromTemplate (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/#react-native-community/cli/build/commands/init/init.js:129:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.initialize [as func] (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/#react-native-community/cli/build/commands/init/init.js:181:3)
at async Command.handleAction (/Users/imac/.npm/_npx/7930a8670f922cdb/node_modules/#react-native-community/cli/build/index.js:106:9)
info Run CLI with --verbose flag for more details.
I have tried removing and reinstalling the following
sudo npm uninstall -g react-native-cli #react-native-community/cli
Nodejs
The problem has been fixed by updating the system to 13.2.1
Then execute
sudo npm uninstall -g react-native-cli #react-native-community/cli
npx react-native init AwesomeProject --npm

How to remove a dependency in my NPM manifest?

Goal: Create a CRA TypeScript app with Yarn.
I run yarn create react-app my-app --template typescript on my terminal. Then I encounter the ff. error message:
yarn create v1.22.10
[1/4] Resolving packages...
warning create-react-app > tar-pack > tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
[2/4] Fetching packages...
error create-strapi-app#3.6.3: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.14.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
And it's super weird and confusing because I'm not trying to create a Strapi project. I check yarn-error.log and I see these lines after the Error Stack Trace:
npm manifest:
{
"dependencies": {
"create-strapi-app": "^3.6.3"
}
}
yarn manifest:
No manifest
So I'm thinking either CRA requires CSA, or somehow my local NPM is configured to always require CSA. I very much doubt the former, so I'm betting it's the latter. (Please correct me if I'm wrong.) Either way, any ideas how I may resolve this?

Error: Module `#nuxtjs/vuetify` not found. (v2.0.0-beta.2)

Because of fibers error on cPanel/CentOS/Cloudlinux servers, I'm using v2.0.0-beta.2 of #nuxtjs/vuetify in my Nuxt app.
But npm returns error on build or dev running.
No problem with v1.11.2, but the alpha and beta versions have error.
✖ Nuxt Fatal Error
Error: Module `#nuxtjs/vuetify` not found. Please ensure `#nuxtjs/vuetify` is in `devDependencies` and
installed. HINT: During build step, for npm/yarn, `NODE_ENV=production` or `--production` should NOT be
used.
package.json
"devDependencies": {
"#nuxtjs/vuetify": "^2.0.0-beta.2"
}
nuxt.config.js
buildModules: [
'#nuxtjs/vuetify'
]
I deleted the node_modules folder and re-runned the npm install and problem solved.
Go through the bellow commands
Delete node_modules
run npm i if you have previously npm installed on you machine otherwise run npm install then run npm i .
run npm run build
run npm run start
I tried Fred solution but didn't work out for me.
However I run this command npm install #nuxtjs/vuetify -D to install the vuetify component and the problem solved.

Error when I try to run an app in android Ionic 4

I have this error when I try to run my app in android
An unhandled exception occurred: [BABEL] C:\Users\UserName\Desktop\Ionic\MyProject\www\32-es2015.js: Could not find plugin "proposal-numeric-separator". Ensure there is an entry in ./available-plugins.js for it. (While processing: "C:\Users\UserName\Desktop\Ionic\MyProject\node_modules\#babel\preset-env\lib\index.js")
See "C:\Users\UserN~1\AppData\Local\Temp\ng-GJZvQx\angular-errors.log" for further details.
[ERROR] An error occurred while running subprocess ng.
as mentioned in this workaround
delete node_modules and package-lock.json
add "resolutions": { "#babel/preset-env": "^7.8.7" } to package.json
npm install npm-force-resolutions --save-dev
npm install
npx npm-force-resolutions
npm install again
run or build your app
if the error persist in future builds of your app try from step 5 before build it.
open package.json
"dependencies": {
"#babel/compat-data": "7.8.0"
}
run command
npm install
and then build your project and it should work.

react-native init gives ESOCKETTIMEDOUT error

I am using a Macbook and when I try to create a React Native app, it throws ESOCKETTIMEDOUT error.
I have tried to clean the npm and yarn cache however it doesn't help.
react-native init AwesomeProject
This will walk you through creating a new React Native project in /Users/gaurang.shah/Documents/personal/code/mobile/AwesomeProject
Using yarn v1.13.0
Installing react-native...
yarn add v1.13.0
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/Users/gaurang.shah/Documents/personal/code/mobile/AwesomeProject/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
I am able to download the https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz file through my browser, so it can't be networking issue.
Stacktrace
Yarn version:
1.13.0
Node version:
11.10.0
Platform:
darwin x64
Trace:
Error: https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (/usr/local/Cellar/yarn/1.13.0/libexec/lib/cli.js:130024:19)
at Object.onceWrapper (events.js:285:13)
at ClientRequest.emit (events.js:197:13)
at TLSSocket.emitRequestTimeout (_http_client.js:669:40)
at Object.onceWrapper (events.js:285:13)
at TLSSocket.emit (events.js:197:13)
at TLSSocket.Socket._onTimeout (net.js:447:8)
at listOnTimeout (timers.js:327:15)
at processTimers (timers.js:271:5)
npm manifest:
{"name":"AwesomeProject","version":"0.0.1","private":true,"scripts":{"start":"node node_modules/react-native/local-cli/cli.js start"}}
yarn manifest:
No manifest
Lockfile:
No lockfile
Had the same issue when retrieving big packages on a slow network. As suggested on this comment, increasing the network timeout for installing the packages worked for me.
Firstly, have your project directory created beforehand and then create a .yarnrc file inside of it having the following content:
network-timeout 600000
Now, just run the react-native init <project_name> command from the parent directory of your project as you did.
It is equivalent to running yarn like so:
yarn install --network-timeout 600000
If npm can be used, please use 'npm install' & it generates package-lock.json or 'yarn install --network-timeout <time in ms>' - generates yarn.lock. Both works for me.