Cannot install any dependency cause by TIMEOUT - javascript

I've got a problem with installing dependencies in my simple node.js project, when i launach yarn add express command then console throw me this error:
C:\Users\...\Desktop\npm-test>yarn add express
yarn add v1.22.4
[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.npmjs.org/express: tunneling socket could not be established, cause=connect ETIMEDOUT 192.25.254.240:8080".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\...\\Desktop\\npm-test\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
can someone tell me what is wrong? Thanks for any help!

Related

NPM: request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH

NPM used to work no problem but now for some reason anything I try to do that involves connecting to the registry times out.
The failure message I get from NPM is request to https://registry.npmjs.org/corepack failed, reason: connect EHOSTUNREACH 2606:4700::6810:1223:443
The command I'm running is npm update -g.
I'm on Arch Linux, and I installed the NPM package from arch. It is version 8.19.2 (the latest on arch).
I tried two DNS, the one I'm using now is Cloudflare (1.1.1.1).
Pinging "registry.npmjs.org" results in From 2600:1700:4630:c000::1 (2600:1700:4630:c000::1) icmp_seq=1 Destination unreachable: Address unreachable
But if I go to registry.npmjs.org in my web browser, I get the expected json result.
Any help is appreciated.
https://askubuntu.com/questions/32298/prefer-a-ipv4-dns-lookups-before-aaaaipv6-lookups/38468#38468
For some reason ipv6 requests are not working on my current network. I "solved" the issue for now by preferring ipv4 using the solution in the link above. Ultimately I'd like to find out why ipv6 is not working on my computer/network but for now this is fine.

yarn start-https failed with error Command failed with exit code 1

I am working on a project that I downloaded, but having trouble setting up and getting the enviroment started.
After yarn install, yarn build, and then yarn start-https, I get this error message:
Error: error:0909006C:PEM routines:get_name:no start line
at node:internal/tls/secure-context:65:13
at Array.forEach (<anonymous>)
at setCerts (node:internal/tls/secure-context:63:3)
at configSecureContext (node:internal/tls/secure-context:152:5)
at Object.createSecureContext (node:_tls_common:116:3)
at Server.setSecureContext (node:_tls_wrap:1344:27)
at Server (node:_tls_wrap:1203:8)
at new Server (node:https:69:3)
at Object.createServer (node:https:105:10)
at Server.createServer (.../node_modules/webpack-dev-server/lib/Server.js:677:35)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I am have followed the set for the readMe file... and I tried googling each line of error message but nothing had helped solved this issue of exiting out.
I feel, that I must be missing something... somthing that was not documented in the readme file...
Any help would be greatly appreciated.
I think you need to check your package.json file and especially the script file
if you share more references of your start file it will grate to understand more
happy to help you
This error showing that you have a problem around ssl settings, you have to prepare self-signed SSL Certificate.

Hostname/IP doesn't match certificate's altnames

I'm working on a react native project and any attempt to install packages from npm fails with the error below.
fitz:tesseractOcrSample fitzmode$ npm i
npm ERR! request to https://registry.npmjs.org/react failed, reason: Hostname/IP doesn't match certificate's altnames: "Host: registry.npmjs.org. is not in the cert's altnames: DNS:a.sni.fastly.net, DNS:a.sni.global-ssl.fastly.net"
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/fitzmode/.npm/_logs/2018-09-01T13_08_53_778Z-debug.log
Looking at other solutions I have tried to set the strict-ssl to false in the npm config to no avail.
I have also tried using yarn instead but get the below.
fitz:tesseractOcrSample fitzmode$ yarn install
yarn install v1.7.0
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/react: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".
info If you think this is a bug, please open a bug report with the information provided in "/Users/fitzmode/Downloads/react-native-tesseract-ocr-master/tesseractOcrSample/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I'm not sure if its a mis-configuration on my network or something else. Any solutions?
This works for me
I have edited my /etc/hosts file and create an entry like this
104.16.109.30 registry.npmjs.org
and it works.
SOLVED
I changed the DNS provider on my machine to OpenDNS. Apparently there may have been a misconfiguration on the npm registry that may be cached by my ISP.
In Preferences > Network > Advanced > DNS (Tab) , I've added 208.67.222.222 and 208.67.220.220 to the list of DNS servers.
More info here here
This works for me
Add
104.16.16.35 registry.yarnpkg.com
to /etc/hosts

ECONNRESET while installing Angular CLI with npm

While trying to install Angular CLI on a machine with no proxy set and flawless internet I get a following error:
4727 silly extract micromatch#^3.1.4 extracted to C:\Users\User\AppData
\Roaming\npm\node_modules\.staging\micromatch-7d604bf4 (38763ms)
4728 timing action:extract Completed in 265532ms
4729 verbose unlock done using C:\Users\User\AppData\Roaming\npm-cache\_locks\staging-eb8de851d6fef93d.lock for C:\Users\User\AppData\Roaming\npm\node_modules\.staging
4730 timing stage:rollbackFailedOptional Completed in 0ms
4731 timing stage:runTopLevelLifecycles Completed in 277531ms
4732 verbose type system
4733 verbose stack FetchError: request to https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz failed, reason: read ECONNRESET
4733 verbose stack at ClientRequest.req.on.err
[...]
4739 error code ECONNRESET
4740 error errno ECONNRESET
4741 error network request to https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz failed, reason: read ECONNRESET
4742 error network This is a problem related to network connectivity.
4742 error network In most cases you are behind a proxy or have bad network settings.
4742 error network
4742 error network If you are behind a proxy, please make sure that the
4742 error network 'proxy' config is set properly. See: 'npm help config'
4743 verbose exit [ 1, true ]
It usually fails on extracting rxjs package. So far I've tried:
Setting registry to a http:// version, but then it fails earlier, every time on is-number package
reinstalling and updating npm/node
clearing the cache after every single operation
disabling the windows firewall
starting the command line with administrator rights
checked that proxy config is null
Nothing seems to be working. Do you have any ideas?
Edit: Maybe this will help, but when I've tried to update npm itself, it would hang itself immediately on rollbackFailedOptional, it managed to update itself only after changing the registry to the http:// version
Downgrade towards a more stable version of node/npm.
To install a specific version of npm, e.g, 5.6.0:
npm install -g npm#5.6.0

selenium webdriver manager update - npm

I tried to update the selenium webdriver using the "webdriver-manager", but i get the error as,
Error: Got error Error: read ECONNRESET from https://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar
Error: Got error Error: read ECONNRESET from https://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar
fs.js:60
throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
^
Error: EPERM: operation not permitted, unlink 'C:\Users\user_name\AppData\Roaming\npm\node_modules\protractor\selenium\selenium-server-standalone-2.48.2.jar'
at Error (native)
I am not sure what was the cause. I tried updating the protractor too, but no luck.
Also i tried running the command prompt as administrator and run
webdriver-manager update --ignore_ssl
Please help.
I have solved the issue as below,
// Update chrome alone
webdriver-manager update --standalone=0 --chrome --alternate_cdn http://chromedriver.storage.googleapis.com/
// Update selenium alone
webdriver-manager update --chrome=0 --standalone --alternate_cdn http://selenium-release.storage.googleapis.com/
I was facing same issue and got the below error when running update chrome driver.
Error: Got error Error: self signed certificate in certificate chain from https://chromedriver.storage.googleapis.com/2.21/chromedriver_win32.zip
I manually downloaded the driver saved it as node_modules\protractor\selenium\chromedriver_2.21.exe
and it worked. I was running it from my office network
it actually works over http as well: http://selenium-release.storage.googleapis.com/2.48/selenium-server-standalone-2.48.2.jar , just find-replace it inside the library.
Or download it manually to: node_modules/protractor/selenium
i had same problem.
Solution for me was updating node.js (best way to do it - just download latest version and install it).

Categories

Resources