npm ERR! code ERR_SOCKET_TIMEOUT npm ERR! errno ERR_SOCKET_TIMEOUT - javascript

Creating a new React app in /home/abhijith/Desktop/React/firstReact/myapp.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! request to https://registry.npmjs.org/find-cache-dir failed, reason: Socket timeout
npm ERR! A complete log of this run can be found in:
npm ERR! /home/abhijith/.npm/_logs/2021-04-08T17_06_38_087Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting myapp/ from /home/abhijith/Desktop/React/firstReact
Done.
i tried sudo npm update npm -g,
npm cache clean --force
still showing this error

I've faced the same issue in node V16.14.0, then I've found two solutions.
Using timeout flag for weak internet connection
npx create-react-app clients -timeout=100000
Downgrade my nodejs version from v16.14.0 to v16.0.0. In v16.0.0, I didn't face the issue.

Related

npx create-react-app show error when installing

npx create-react-app shoing eror whent installing, please help me how to solve this
problem. my nodejs version is v16.14.2 and npm version is 8.5.0
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1354 packages in 1m
171 packages are looking for funding
run `npm fund` for details
Initialized a git repository.
Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: instagram-clone#0.1.0
npm ERR! Found: react#18.0.0
npm ERR! node_modules/react
npm ERR! react#"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"<18.0.0" from #testing-library/react#12.1.5
npm ERR! node_modules/#testing-library/react
npm ERR! #testing-library/react#"^12.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/psn/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/psn/.npm/_logs/2022-04-12T07_12_21_032Z-debug-0.log
`npm install --no-audit --save #testing-library/jest-dom#^5.14.1 #testing-
library/react#^12.0.0 #testing-library/user-event#^13.2.1 web-vitals#^2.1.0` failed
Sounds like you are running npx create-react-app command in a project that already includes react. Try running npm install instead.
If that does not work try to remove your node_modules folder and run npm install again.
You can try the following:
Delete both node_modules and package-lock.json
Run npm i web-vitals --save-dev
Run npm install

How to fix npm ERR! Cannot find module './src/table' when running npx create-react-app

On Windows 10, I am getting this error: npm ERR! Cannot find module './src/table' when trying to start a new project with
npx create-react-app my-app. I searched around but really couldn't find anything about this module './src/table'
Here is the log:
$ npx create-react-app my-app
Creating a new React app in D:\reandomDirectory.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module './src/table'
npm ERR! Require stack:
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\cli-table3\index.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\npm-audit-report\reporters\detail.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\node_modules\npm-audit-report\index.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\lib\install\audit.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\lib\install.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\lib\npm.js
npm ERR! - C:\Users\MyPC\AppData\Roaming\nvm\v12.16.1\node_modules\npm\bin\npm-cli.js
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\MyPC\AppData\Roaming\npm-cache\_logs\2021-05-24T01_01_52_667Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting my-app/ from D:\reandomDirectory
Done.
I have version 3.4.1 globally installed and even if I try to uninstall it I get the same error.
Also, the directory where I am trying to start the project is completely empty.
Any idea of how I could fix this?

Library is not importing

I am trying to import the react-navigation library in my react native project.
But it is giving me this error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: IbexCrypto#0.0.1
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"17.0.1" from the root project
npm ERR! peer react#"*" from #react-navigation/stack#5.14.3
npm ERR! node_modules/#react-navigation/stack
npm ERR! #react-navigation/stack#"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.0" from #react-native-community/masked-view#0.1.10
npm ERR! node_modules/#react-native-community/masked-view
npm ERR! peer #react-native-community/masked-view#">= 0.1.0" from #react-navigation/stack#5.14.3
npm ERR! node_modules/#react-navigation/stack
npm ERR! #react-navigation/stack#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\me\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\me\AppData\Local\npm-cache\_logs\2021-03-17T15_24_47_867Z-debug.log
It is also giving me the same error while I try to import some other libraries too.
Previously when I import the navigation library in my old project it works fine but now it is giving me this error.
Kindly, someone tells me why this error is showing. And how to resolve the issue and how to avoid the same problem in the future.
I will be very thankful if someone helps me as I am a relative beginner in development and do not know the logic of this error.
use commond
npm install #react-navigation/native
for import the react-navigation library
You have a dependency conflict! It means that you have an incorrect and potentially broken dependency.
Try this first:
rm -rf node_modules/
npm install
This command removes the node_modules folder and then installs the dependencies you have in your package.json
If it doesn't work, try to run npm install with the command --force or --legacy-peer-deps.
In your case:
npm install #react-navigation/native --force
or: npm install #react-navigation/native --legacy-peer-deps
Description of the commands:
--force: forces npm install to install the dependencies you want to install.
-legacy-peer-deps: --legacy-peer-deps: ignore all peerDependencies when installing.
These commands it's necessary in some cases but as standard npm install should be enough to install the dependencies from your package.json file.
For your issues, this two command may works
npm install --legacy-peer-deps
or
npm install --force
React navigation command in version 3 and 4
npm install —-save react-navigation
There are some minor changes in navigation 4
React navigaiton
React navigation command in version 5
npm install #react-navigation/native
You can import like below code
import { createAppContainer } from "react-navigation";
please refer official docs for react-navigation and install all the necessery dependency from here:
https://reactnavigation.org/docs/getting-started
after installing dependency run
react-native start --reset-cache
and then
react-native run-android

create-react-app ERR! 404 Object Not Found

I'm trying to run create-react-app (npx create-react-app fetching-images), it loads for a while then I get this error every time:
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code E404
npm ERR! 404 Object Not Found - GET https://skimdb.npmjs.com/registry/cyclist/-/cyclist-1.0.1.tgz - not_found
npm ERR! 404
npm ERR! 404 'cyclist#https://skimdb.npmjs.com/registry/cyclist/-/cyclist-1.0.1.tgz' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Eric/.npm/_logs/2021-03-14T10_02_15_171Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
I completely uninstalled node, npm and npx, and then reinstalled the newest version from https://nodejs.org/en/ but still get the this error. I'm on macOS(v.11.2.2), npm v.7.6.0, node v.15.11.0.
How do I fix this error?
Please try setting this:
npm config set registry http://registry.npmjs.org

i'm having issues creating my React app using npx-create-reat-app

$ npx create-react-app robot
npx: installed 67 in 583.936s
Creating a new React app in C:\Users\User\ReactApps\robot.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz failed, reason: socket hang up
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache_logs\2021-01-21T18_37_39_680Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... package.json
Deleting robot/ from C:\Users\User\ReactApps
Done.
Check this one hope you create react app
1 check your nodejs version
node -v
2 check your npm version
npm -v
3.you globally installed your react app
4.Go terminal and root path
npx create-react-app appname
Uninstall the [nodejs] (https://nodejs.org/en/download/)!
Install it again
it works I have tried it.

Categories