ECONNRESET while installing Angular CLI with npm - javascript

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

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.

Reac-native running first time

I´m new in react-native and I´m trying run my first helloworld project.
But I´m getting this error
How could I solve this?
info Running jetifier to migrate libraries to AndroidX. You can
disable it using "--no-jetifier" flag. Jetifier found 863 file(s) to
forward-jetify. Using 4 workers... info Starting JS server... info
Installing the app...
FAILURE: Build failed with an exception.
What went wrong: Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve org.webkit:android-jsc:+.
Required by:
project :app
Failed to list versions for org.webkit:android-jsc.
Unable to load Maven meta-data from https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml.
Could not get resource 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Could not GET 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Received status code 522 from server: Origin Connection Time-out
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 48s
error Failed to install the app. Make sure you have the Android
development environment set up:
https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment.
Run CLI with --verbose flag for more details. Error: Command failed:
gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong: Could not determine the dependencies of task ':app:preDebugBuild'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve org.webkit:android-jsc:+.
Required by:
project :app
Failed to list versions for org.webkit:android-jsc.
Unable to load Maven meta-data from https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml.
Could not get resource 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Could not GET 'https://jitpack.io/org/webkit/android-jsc/maven-metadata.xml'.
Received status code 522 from server: Origin Connection Time-out
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 48s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Users\amaro.manungu\AmaroProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:74:39)
at buildAndRun (C:\Users\amaro.manungu\AmaroProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\amaro.manungu\AmaroProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\Users\amaro.manungu\AmaroProject\node_modules\react-native\node_modules\#react-native-community\cli\build\cliEntry.js:160:7)
Change the following in android/build.gradle
maven { url 'https://jitpack.io' }
to
maven { url 'https://www.jitpack.io' }
Source: https://stackoverflow.com/a/52812651/1889732
build the project with offline mode.
you can toggle the offline mode button on in android studio.
if you build project use command line add --offline at the end of the gradle command.

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

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).

TheIntern Dojo example exits with timeout error

The Example of Dojo tests run under Intern (https://github.com/theintern/intern-examples/tree/master/dojo-example) does not actually test anything, fails on connect to the Sauce network:
$ npm test
> dojo-intern-example#0.1.0 test /home/bogdanbiv/WebstormProjects/intern-examples/dojo-example
> intern-runner config=tests/intern
Listening on 0.0.0.0:9001
Starting tunnel...
Using no proxy for connecting to Sauce Labs REST API.
**********************************************************
A newer version of Sauce Connect (build 1283) is available!
Download it here:
https://saucelabs.com/downloads/sc-4.3-linux.tar.gz
**********************************************************
Started scproxy on port 49172.
Starting secure remote tunnel VM...
Secure remote tunnel VM provisioned.
Tunnel ID: 2f904e21cf1e4c3e83f63a4b3089127c
Secure remote tunnel VM is now: booting
Secure remote tunnel VM is now: running
Remote tunnel host is: maki76020.miso.saucelabs.com
Using no proxy for connecting to tunnel VM.
Establishing secure TLS connection to tunnel...
Cleaning up.
Finished! Deleting tunnel.
Error: failed to connect to tunnel VM.
Error: failed to connect to tunnel VM.
at reject <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:353:17>
at readStartupMessage <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:381:12>
at <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:434:12>
at Array.some <native>
at Socket.<anonymous> <node_modules/intern/node_modules/digdug/SauceLabsTunnel.js:428:21>
at Socket.EventEmitter.emit <events.js:117:20>
at Socket.<anonymous> <_stream_readable.js:746:14>
at Socket.EventEmitter.emit <events.js:92:17>
at emitReadable_ <_stream_readable.js:408:10>
at emitReadable <_stream_readable.js:404:5>
npm ERR! weird error 1
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! not ok code 0
Ok it does complain about having an old Sauce Connect binary, but even after downloading and inserting the path of the newest SC (4.3). I also updated .bin/intern-runner to contain js as a running environment as opposed to the old node command. User and password are the ones from the repository (left them unchanged). I followed the documentation and did uncomment the tunnel in the intern config file.
UPDATE: This problem still occurs. I find it wierd that a proxy is started Started scproxy on port 54687., but, further down, Using no proxy for connecting to tunnel VM.. Aren't these lines supposed to match?
It could be that this mismatch has nothing to do with the original problem? The new Sauce Connect binary is still ignored.
UPDATE: Actually this solution affects only client, local - intern-client config=tests/intern. As a result this solution solves a different problem than the one originally posted. /UPDATE
The problem was that although I executed bower install as documented, the bower components installed in a folder set by the bowerrc global configuration. This was quite different from what the Dojo TodoMVC example required for its components.
Also submitted an issue at https://github.com/theintern/intern-examples/issues/10 and a pull request.

Categories

Resources