Error when I want to create react app: error Couldn't find package "jest-watch-typeahead#^1.0.0" required by "react-scripts" on the "npm" registry - error-handling

I get this error when I use CRA and I start it with yarn. Although I searched for that on the stack I can't find a solution for that:
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error Couldn't find package "jest-watch-typeahead#^1.0.0" required by "react-scripts" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts cra-template --cwd F:\projects\notes has failed.
Deleting generated file... package.json
Deleting notes/ from F:\projects
Done.
error Command failed.
Exit code: 1
Command: C:\Users\arman\AppData\Local\Yarn\bin\create-react-app
Arguments: notes
Directory: F:\projects
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
It says about network connections, but my connection doesn't have any problem and I ran it several times. Is it possible that my problem is sanctions against Iran?
What's the problem and what do I have to do for fixing it?

Related

yarn CRA failed

MBP:~ Tim$ yarn create react-app my-app --template typescript
yarn create v1.22.19
[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: "http://nexus.qcpaws.qantas.com.au/nexus/repository/npm-repo/fstream/-/fstream-1.0.11.tgz: getaddrinfo ENOTFOUND nexus.qcpaws.qantas.com.au".
info If you think this is a bug, please open a bug report with the information provided in "/Users/benli/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
So when I use yarn to create React App, it will try to install a package from qantas.com.au
I worked at Qantas before, so I must have set the registry somewhere.
So far, I've tried:
run yarn cache clearn to clean the cache, not working
uninstall yarn globally and re-install again, not working
check yarn config list to list the config, but cannot find qantas.com related information
checked .npmrc and .yarnrc, but cannot find any clues
Can someone help me how to remove the nexus registry?
thanks

Error: ": Unexpected token \u0000 in JSON at position 0" when using yarn to add a react package

I am trying to install the following package through yarn yarn add react-native-gesture-handler#1.10.2. I read multiple answers to this question yet none was of use. I think the problem might come from the fact I am on a windows computer yet don't know how to solve it.
Whenenever y try to do a yarn add ..#version I get the following error:
yarn add v1.22.11
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is
advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "C:\\Users\\...\\AppData\\Local\\Yarn\\Cache\\v6\\npm-unbox-primitive-1.0.1-085e215625ec3162574dc8859abee78a59b14471-integrity\\node_modules\\unbox-primitive\\.yarn-metadata.json:
Unexpected token \u0000 in JSON at position 0".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\...\\OneDrive\\Documents\\GitHub\\wc_app\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
I have same problem with installing next.js app many times
now its fixed
with clear cache of yarn
yarn cache clean
I have faced a similar problem while creating a latest react native project(0.65) in my Windows machine:
error An unexpected error occurred: "C:\Users\arefin\AppData\Local\Yarn\Cache\v6\npm-is-ci-3.0.0-c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994-integrity\node_modules\is-ci\.yarn-metadata.json: Unexpected token \u0000 in JSON at position 0".
My system configuration for react native development is as follows:
node --version: v15.7.0
yarn --version: 1.22.5
npm --version: 7.12.1
java --version: java 15.0.2 2021-01-19
I used these commands below, which finally solved the problem in my case:
yarn init && yarn add react-native && yarn react-native init
SpendnGain
which I found at here

Yarn Install packages over proxy - trouble with your network

I'm having a issue with proxy on my work, I've already added proxy config and can run yarn commands such serve.
Now this is a new problem I'm facing, I can't npm install or even yarn install, what should I do to install?
Edit: --network-timeout 100000 don't work.
This is what I want to use: https://www.creative-tim.com/product/vue-black-dashboard
C:\Users{my-user}\Documents\Github\vue-black-dashboard-master>yarn
install yarn install v1.22.5
info No lockfile found.
[1/4] Resolving 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/chart.js: connect ETIMEDOUT
104.16.21.35:443". info If you think this is a bug, please open a bug report with the information provided in
"C:\Users\{my-user}\Documents\Github\vue-black-dashboard-master\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation
about this command.
Try something like this npm --https-proxy=http://proxy.company.com:8080 install package.
Check out this link for more information
First check if 'https-proxy' exist in yarn config: yarn config list
If not, try adding a new value as follows:
yarn config set https-proxy http://proxy.myproxy.com:8080

Yeoman, npm install errors registry

When trying the Excel Addin Tutorial (https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=yeomangenerator) I get an error when running npm start :
> office-addin-taskpane-js#0.0.1 start D:\sheet_organizer
> office-addin-debugging start manifest.xml
Debugging is being started...
App type: desktop
Enabled debugging for add-in sheet_organizer. Debug method: 0
Starting the dev server... (webpack-dev-server --mode development)
The dev server is running on port 3000. Process id: 8456
Sideloading the Office Add-in...
Error: Unable to start debugging.
Error: Unable to sideload the Office Add-in.
Error: Unable to delete registry value "D:\sheet_organizer\manifest.xml" in key "HKCU\SOFTWARE\Microsoft\Office\16.0\Wef\Developer".
ProcessUncleanExitError: DELETE command exited with code 1:
Error: can't find the key or the value
I check manually the key. There is a Developper>05c2e1c9-3e1d-406e-9a91-e9ac64854143 folder
With UseDirectDebugger, UseLiveReload and UseWebDebugger
So the key exist. Don't understand why it is not working.
Yes, this issue was fixed. OfficeDev/Office-Addin-Scripts#215
Please get the latest version of office-addin-debugging.
There are a couple of ways to do this.
1- npm update --dev can update all packages according to semver. (You can see outdated packages using npm outdated --long.)
2- You could update office-addin-debugging package using npm install -D office-addin-debugging.
Ref:https://github.com/OfficeDev/office-js-docs-pr/issues/1321

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.