Hostname/IP doesn't match certificate's altnames - javascript

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

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.

Cannot install any dependency cause by TIMEOUT

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!

npm install hanging due to possible incorrect url

When I run npm install --verbose The installation hangs at:
npm http fetch GET 200 https://na.artifactory.swg-devops.com/artifactory/api/npm/wcp-cos-de-npm-virtual/chai-as-promised 1533ms
βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ™ loadDep:tstest: sill pacote range manifest for chai-as-promised#^7.1.1 fetched in 1558ms
I pasted the url ttps://na.artifactory.swg-devops.com/artifactory/api/npm/wcp-cos-de-npm-virtual/chai-as-promised into my browser and was prompted with a login. Is it possible I have the wrong URL set? If not that what could be causing this to hang?
I also tried running npm install --registry=https://registry.npmjs.org/ --verbose but it hangs here:
npm http fetch GET 200 https://registry.npmjs.org/chai-as-promised 25ms (from cache)
βΈ¨ β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘βΈ© β ™ loadDep:tstest: sill pacote range manifest for chai-as-promised#^7.1.1 fetched in 50ms
You need to authenticate your npm client first.
See the heading Authenticating the Npm Client in this link
https://www.jfrog.com/confluence/display/RTF/Npm+Registry
npm config set loglevel info and then run npm i again
then restart the system.

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

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