Installing Express in Node.js - node.js

I am getting error while installing Express to use in Node.js
I have attached screenshot of the command prompt.
I am not getting what this error is. Please let me know what this error say, so that I can fix it.

Possible problems:
no internet connection
DNS resolver misconfigured
proxy settings required
You can try the following commands to narrow down the problem:
host registry.npmjs.org
ping registry.npmjs.org
curl http://registry.npmjs.org/
curl https://registry.npmjs.org/

Related

How to fix ETIMEDOUT error after npm install?

This is the error I receive:
I get similar errors in other projects as well after npm install.
First make sure that the server you are trying to access is up. The address is a little sketchy. Ping should do the trick:
$ ping http://bbdr.dcc.com.de:5005
If pinging is successful, make sure that your firewall is not blocking traffic.
If you are behind a proxy, check if $ ping http://bbdr.dcc.com.de:5005 works.
And if you are not behind any proxy, then try below commands -
npm config delete proxy
npm config delete http-proxy
npm config delete https-proxy

NodeJs API msrestazure proxy issue

I've a nodejs api that uses npm package msrestazure.
From my local development I've to pass via enterprise proxy to get to the internet.
When I try msRestAzure.loginWithServicePrincipalSecret I get a connection timeout due to the fact that request doesn't use the proxy.
Error: connect ETIMEDOUT 52.143.136.20:443
If someone knows how I can force the usage of the proxy tell me.
For info i've tested multiple solution
set proxy environment variable : not running
use netsh winhttp to set proxy : not running
use software proxycap : it runs. But software is not free and can't request to other developper to use it.
Any has an idea ?? Issue is only for request done by the package.
If i use http request to do the request my self, it works :(
Thanks for your help
sorry for delay ...
Solution is to use package npm dotenv and add HTTP_PROXY and HTTPS_PROXY variable in it.
Hope that can help :)

Access watson retrieve and rank behind a proxy in Node

I need to know if the R&R service can be used behind a proxy.
Take a look at the next part to see my investigations.
The code I'm using was working at my home. (No firewall/No Proxy, only a router)
I started from the following code.
https://console.eu-gb.bluemix.net/catalog/starters/personality-insights-nodejs-web-starter
I try to execute it locally and it was working using the following configuration to be able to install the modules.
npm config set registry http://registry.npmjs.org
npm config set proxy http://x.x.x.x:xx
npm config set https-proxy http://x.x.x.x:xx
npm config set strict-ssl false
set http_proxy=http://x.x.x.x:xx
set https_proxy=http://x.x.x.x:xx
set HTTP_PROXY=http://x.x.x.x:xx
set HTTPS_PROXY=http://x.x.x.x:xx
As it was working I started playing around with R&R. But I'm only having an error.
Error searching for documents: Error: connect ETIMEDOUT 158.85.132.88:443
Where the ip address corresponds gateway.watsonplatform.net
ping gateway.watsonplatform.net
PING gateway.watsonplatform.net (158.85.132.88) 56(84) bytes of data.
Because of the firewall the ping are blocked
During my investigations I found that when executing my test for the R&R service every time two ICMP request are send.
Probably because of the firewall. But why this service would need to send ICMP packets ?
Just to recap:
The code is working when there is no firewall/no proxy
The personnality Insight service is working behind proxy/firewall
The R&R isn't
EDIT
After some investigations I've found that there was a bug in the Solr-client so it is currently impossible to make it work.
More info here on this github issue.

Error: Invalid protocol

I am facing this issue while making a request to any url using NodeJS.
FYR i have made a script in nodejs which is using request module that calls a page and then scrap that html page but the issue is when it calls i gets an error "Error: Invalid protocol: 10.112.62.78".
My .npmrc file contains following lines
proxy=http://10.112.62.78:8080
https-proxy=http://10.112.62.78:8080
registry=http://registry.npmjs.org/
and i still get following error
[Error: Invalid protocol: 10.112.62.78:]
I have tried all possible combinations of following
http://user:password#proxy:port
http://"user:password"#proxy:port
For the above two i get "URI Malformed error"
Still no solution
http://proxy.company.com:port
FYI Versions are as follows:
>node -v
>v0.12.0
>npm -v
>2.5.1
There is one more info i have static ip of 10.112.111.86 in IPv4 and ip of 10.112.62.78 with 8080 in Proxy Setting of Browser . Also i am using Windows 7 desktop and i tried with Proxy IP of 10.112.62.78 & without it but no solution however i can't change the IPv4 otherwise my internet connection would be gone.
Please provide some solution i am stuck.
PS: Also tried by changing http To https for https-proxy .
Npmrc is used by npm, not (afaik) requests within your node code, so this is probably a red herring. What code are you using to make the request?

installing Ionic Framework in node js

I am getting an error when installing Ionic framework in node js. I am behind a proxy but I already set-up my node config to a proper proxy.
Here is the error message:
error network tunneling socket could not be established, cause=read
ECONNRESET error network This is most likely not a problem with npm
itself error network and is related to network connectivity. error
network In most cases you are behind a proxy or have bad network
settings. error network error network If you are behind a proxy,
please make sure that the error network 'proxy' config is set
properly. See: 'npm help confi
Try installing older version of Node(0.10.38).
Already answere here https://stackoverflow.com/a/31124491/1276616
Try to use this
1) Check if u have a proxy
npm config get proxy
2) If u have, remove them
npm config rm proxy
npm config rm https-proxy
I hope be useful.
Source: How clear proxy npm

Resources