I cannot install any node package with npm - networking

I upgraded my npm to the latest version and now I can't run any npm command again, I uninstalled the node js and downloaded it again,
when I ran npm install -g ionic#latest I got this error in my command prompt:
npm WARN deprecated ionic#5.4.16: The Ionic CLI now uses ✨ #ionic/cli ✨ for its package name! 👉 https://twitter.com/ionicframework/status/1223268498362851330
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/env-paths failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\De Stone Of David\AppData\Roaming\npm-cache\_logs\2020-03-23T11_48_48_277Z-debug.log
I don't know what to do now, I also ran npm cache clean --force in powershell as admin and got the same error.

This is a case where reading the error message carefully can help. The key line is
npm ERR! network request to https://registry.npmjs.org/env-paths failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org
ENOTFOUND is a message delivered by your OS to npm. It means npm's attempt to use the Domain Name Service (DNS) to look up that registry machine's hostname failed.
So, you have a networking-connectivity problem, or, less likely, a firewall problem. Try this on a command line on your machine.
curl https://registry.npmjs.org
If it, too, doesn't work, try rebooting your machine. If that doesn't work, ask a network engineer for help and mention the curl command as evidence of the problem.
Some home ISPs (I'm looking at you, Comcast) sometimes have connectivity trouble that shows up as DNS failures. Power-cycle your cable modem and router. If that doesn't help, call tech support and ask them to reset your modem remotely.
If you have a VPN in use try disconnecting from it, then try your npm operation again. If it works without the VPN, then ask the person who maintains the VPN for help.
I have no trouble getting to that hostname from my location.

Related

tunneling socket could not be established | yarn create next-app

When I try to look up for this kind of problem, most are because they were using a proxy, but I don't. I get this error on my git bash:
$ yarn create next-app firstapp
yarn create v1.22.19
[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/create-next-app: tunneling socket could not be established, cause=getaddrinfo ENOTFOUND 8889".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\username\\AppData\\Local\\Yarn\\Data\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
I'm following the guide on nextjs.org. I thought it was due to my bad connection, but when I try it another time, I still get the same error.
My Node.js is at v14.17.5.

kubernetes nginx upstream server as service not found

These are my yaml files referenced by here (kubernetes.io/docs)
deployment gists
And I use command kubectl apply -f backend-deployment.yaml -f frontend-configmap.yaml -f frontend-deployment.yaml
Backend were launched successfully, but Frontend occured error.
[emerg] 1#1: host not found in upstream "backend-service" in /etc/nginx/conf.d/nginx.conf:2
#nginx: [emerg] host not found in upstream "backend-service" in /etc/nginx/conf.d/nginx.conf:2
Even if 'backend-service' is declared, nginx couldn't recognize it.
Command nslookup backend-service result is:
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find backend-service: SERVFAIL
What am I missing?
I have gotten closer to the issue/solution.
First of all, you if the images in your supplied answer are correct, you are running nginx in your backend deployment and node-js server on your frontend deployment. This is a mistake.
after changing the images frontend is running (as expected) but backend pod is crashing.
However, the backend pod is successfully resolving the mysql-service to its internal clusterIp and I appear to have wrong authentication setup.
`> server#1.0.0 start /usr/src/app
> node backend.js
(node:18) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:18) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:18) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:18) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
listening on 3000
events.js:292
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 10.100.77.32:3306
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1142:16)
--------------------
at Protocol._enqueue (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/usr/src/app/node_modules/mysql/lib/Connection.js:116:18)
at Object.<anonymous> (/usr/src/app/backend.js:58:12)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
Emitted 'error' event on Connection instance at:
at Connection._handleProtocolError (/usr/src/app/node_modules/mysql/lib/Connection.js:423:8)
at Protocol.emit (events.js:315:20)
at Protocol._delegateError (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:398:10)
at Handshake.<anonymous> (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:153:12)
at Handshake.emit (events.js:315:20)
at Handshake.Sequence.end (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:78:12)
at Protocol.handleNetworkError (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:369:14)
at Connection._handleNetworkError (/usr/src/app/node_modules/mysql/lib/Connection.js:418:18)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:96:8)
at emitErrorCloseNT (internal/streams/destroy.js:68:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: -111,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '10.100.77.32',
port: 3306,
> node backend.js
fatal: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#1.0.0 start: `node backend.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-07-21T08_46_32_833Z-debug.log`
if you look at the log. it says it tries to connect to 10.100.77.32:3306 and the output of kubectl get svc is the following mysql-service ClusterIP 10.100.77.32 <none> 3306/TCP 17m
with the matching ip of my service.
kubectl get endpoints shows that the mysql-service has indeed found an endpoint:
mysql-service ClusterIP 10.100.77.32 <none> 3306/TCP 17m
and here is additional log information showing that the authentication mechanism of your nodejs application appearently is not working for the mysql pod.
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/usr/src/app/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/usr/src/app/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/usr/src/app/node_modules/mysql/lib/Connection.js:88:28)
at Socket.<anonymous> (/usr/src/app/node_modules/mysql/lib/Connection.js:526:10)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:296:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
--------------------
at Protocol._enqueue (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/usr/src/app/node_modules/mysql/lib/Connection.js:116:18)
at Object.<anonymous> (/usr/src/app/backend.js:58:12)
at Module._compile (internal/modules/cjs/loader.js:1185:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1205:10)
at Module.load (internal/modules/cjs/loader.js:1034:32)
at Function.Module._load (internal/modules/cjs/loader.js:923:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
Emitted 'error' event on Connection instance at:
at Connection._handleProtocolError (/usr/src/app/node_modules/mysql/lib/Connection.js:423:8)
at Protocol.emit (events.js:315:20)
at Protocol._delegateError (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:398:10)
at Handshake.<anonymous> (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:153:12)
at Handshake.emit (events.js:315:20)
at Handshake.Sequence.end (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:78:12)
at Handshake.ErrorPacket (/usr/src/app/node_modules/mysql/lib/protocol/sequences/Handshake.js:125:8)
at Protocol._parsePacket (/usr/src/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
[... lines matching original stack trace ...]
at readableAddChunk (_stream_readable.js:272:9) {
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client',
sqlState: '08004',
fatal: true
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#1.0.0 start: `node backend.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-07-21T08_55_22_133Z-debug.log
However, with the changes suggest at the beginning of the answer the issues around resolving the service name and communicating inside of kubernetes should be resolved.
backend-deployment image : bateaux/test-nginx
frontend-deployment image : bateaux/test-node-server
When deploy backend-deployment, remove [livenessProbe, readinessProbe].
Because node.js express server use #cloudnative/health-connect To readinessProbe, so call PingCheck(worker node ip).
Wow....I found solution for getaddrinfo EAI_AGAIN mysql-service.
I think if network can't find service, there is error in dns.
kubectl logs --namespace=kube-system -l k8s-app=kube-dns
Result of command is gist.
So...I finally found this link about kubernetes coredns.
By belphegor's answer, it works restart coredns.
Although, there is new error Client does not support authentication protocol requested by server; consider upgrading MySQL client, but i think to solve it is easier than dns error. hhhhhhhhhhhhhhhh

bootstrap clodufiy3.4 error occured

I installed cloudify3.4 according to the cloudify DOCS. When I install the manager, and executed like this:
# cfy bootstrap --install-plugins -p openstack-manager-blueprint.yaml -i openstack-manager-blueprint-inputs.yaml
an error occurred:
[ERROR] Workflow failed: Task failed 'fabric_plugin.tasks.run_script' -> Timed out trying to connect to 192.168.17.15 (tried 5 times)
I have already build a extern network 192.168.17.0/24 and I have already installed
cloudify_docker_plugin-1.3.2-py27-none-linux_x86_64-Ubuntu-trusty.wgn
cloudify_fabric_plugin-1.4.1-py27-none-linux_x86_64-centos-Core.wgn
cloudify_fabric_plugin-1.4.1-py27-none-linux_x86_64-redhat-Maipo.wgn
cloudify_host_pool_plugin-1.4-py27-none-linux_x86_64-centos-Core.wgn
cloudify_openstack_plugin-1.4-py27-none-linux_x86_64-redhat-Maipo.wgn
So, how to solve this error? Thank you to everyone who helped me!
It seems that you can't connect the manager.
Please make sure that you have an ssh connection from the CLI to the manager.
Since you are bootstrapping an Openstack manager you should make sure to have an external IP if you are outside of Openstack or that the CLI is on the same network if you are on Openstack.

Npm requests stopped by home router

Good day.
My machine runs on windows 7 32 bit. I've installed Node.jS via installer from nodejs.org.
When i try to do anything with NPM http request involved, it just stalls. No errors, just continues on and on forever.
With try and error I came to conclusion it is the fault of my home router. I tried setting up DMZ, port forwarding on :80 but nothing helps. Maybe the port is wrong, but i can't find which one to forward.
I don't use proxy and have dynamic ip.
this is how it goes:
C:\Users\By-the-ocean\Desktop\delme>npm install -ddd express
npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
npm verb cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'install',
npm verb cli '-ddd',
npm verb cli 'express' ]
npm info using npm#2.10.1
npm info using node#v0.12.4
npm verb install initial load of C:\Users\By-the-ocean\Desktop\delme\package.json
npm verb readDependencies loading dependencies from C:\Users\By-the-ocean\Desktop\delme\package.json
npm sill cache add args [ 'express', null ]
npm verb cache add spec express
npm sill cache add parsed spec { raw: 'express',
npm sill cache add scope: null,
npm sill cache add name: 'express',
npm sill cache add rawSpec: '',
npm sill cache add spec: '*',
npm sill cache add type: 'range' }
npm sill addNamed express#*
npm verb addNamed "*" is a valid semver range for express
npm sill addNameRange { name: 'express', range: '*', hasData: false }
npm sill mapToRegistry name express
npm sill mapToRegistry using default registry
npm sill mapToRegistry registry https://registry.npmjs.org/
npm sill mapToRegistry uri https://registry.npmjs.org/express
npm verb addNameRange registry:https://registry.npmjs.org/express not in flight;
fetching
npm verb request uri https://registry.npmjs.org/express
npm verb request no auth needed
npm info attempt registry request try #1 at 09:18:50
npm verb request id 50d2de54ad349278
npm http request GET https://registry.npmjs.org/express
/
A bit more details:
I'm on plain windows laptop connected to internet via router.
The request comes from the same machine to NPM servers (both http and https versions have been tried)
There is no way for me to connect without router directly via cabel.
Windows firewall has been turned off completely. no firewall on router either.

Meteorite mrt Command Not Working on MAC

I need to install meteorite on a Mac. I am trying to install meteorite as shown below.
HOMEs-Mac-mini:~ home$ npm -v
1.4.9
HOMEs-Mac-mini:~ home$ node -v
v0.10.28
Then :
HOMEs-Mac-mini:~ home$ sudo -H npm install -g meteorite
The Outcome is :
npm http GET https://registry.npmjs.org/meteorite
npm http 304 https://registry.npmjs.org/meteorite
npm http GET https://registry.npmjs.org/ddp
npm http GET https://registry.npmjs.org/wrench
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/fstream
npm http GET https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/prompt
npm http GET https://registry.npmjs.org/colors
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/rolling_timeout_exec
npm http 304 https://registry.npmjs.org/wrench
npm http 304 https://registry.npmjs.org/fstream
npm http 304 https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/ddp
npm http 304 https://registry.npmjs.org/prompt
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/rolling_timeout_exec
npm http GET https://registry.npmjs.org/node-srp
npm http GET https://registry.npmjs.org/meteor-ejson
npm http GET https://registry.npmjs.org/faye-websocket
npm http GET https://registry.npmjs.org/rimraf
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/graceful-fs
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/wordwrap
npm http GET https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/pkginfo
npm http GET https://registry.npmjs.org/read
npm http GET https://registry.npmjs.org/revalidator
npm http GET https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/utile
npm http 304 https://registry.npmjs.org/faye-websocket
npm http 304 https://registry.npmjs.org/node-srp
npm http 304 https://registry.npmjs.org/meteor-ejson
npm http 304 https://registry.npmjs.org/rimraf
npm http 304 https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/websocket-driver
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/graceful-fs
npm http 304 https://registry.npmjs.org/pkginfo
npm http 304 https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/read
npm http 304 https://registry.npmjs.org/revalidator
npm http 304 https://registry.npmjs.org/websocket-driver
npm http 304 https://registry.npmjs.org/utile
npm http 304 https://registry.npmjs.org/winston
npm http GET https://registry.npmjs.org/mute-stream
npm http GET https://registry.npmjs.org/deep-equal
npm http GET https://registry.npmjs.org/i
npm http GET https://registry.npmjs.org/ncp
npm http GET https://registry.npmjs.org/cycle
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/stack-trace
npm http GET https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/i
npm http 304 https://registry.npmjs.org/deep-equal
npm http 304 https://registry.npmjs.org/ncp
npm http 304 https://registry.npmjs.org/cycle
npm http 304 https://registry.npmjs.org/mute-stream
npm http 304 https://registry.npmjs.org/stack-trace
npm http 304 https://registry.npmjs.org/request
npm http 304 https://registry.npmjs.org/eyes
/usr/local/bin/mrt -> /usr/local/lib/node_modules/meteorite/bin/mrt.js
> meteorite#0.7.4 postinstall /usr/local/lib/node_modules/meteorite
> sh ./completions/postinstall.sh
meteorite#0.7.4 /usr/local/lib/node_modules/meteorite
├── rolling_timeout_exec#0.0.1
├── colors#0.6.0-1
├── wrench#1.3.9
├── async#0.2.9
├── underscore#1.3.3
├── fstream#0.1.25 (inherits#2.0.1, graceful-fs#2.0.3, rimraf#2.2.8, mkdirp#0.3.5)
├── optimist#0.6.1 (wordwrap#0.0.2, minimist#0.0.10)
├── ddp#0.4.6 (meteor-ejson#0.6.3, node-srp#0.0.1, faye-websocket#0.7.2)
└── prompt#0.2.11 (revalidator#0.1.8, pkginfo#0.3.0, read#1.0.5, utile#0.2.1, winston#0.6.2)
after That :
HOMEs-Mac-mini:~ home$ meteor create appdemo
appdemo: created.
To run your new app:
cd appdemo
meteor
HOMEs-Mac-mini:~ home$ cd appdemo
Add Package using mrt below :
HOMEs-Mac-mini:appdemo home$ mrt add router
Here mrt not working gets error as shown below :
Stand back while Meteorite does its thing
✓ router
tag: https://github.com/tmeasday/meteor-router.git#v0.6.1
ERROR: 128 Command failed: fatal: Not a git repository (or any of the parent directories): .git
STDOUT:
STDERR: fatal: Not a git repository (or any of the parent directories): .git
/usr/local/lib/node_modules/meteorite/lib/sources/git.js:181
self.checkoutType + ": " + (self.commit || self.head);
^
There was a problem checking out tag: v0.6.1
HOMEs-Mac-mini:appdemo home$
I didn't get any idea about this.Can you please suggest me what to do?.
I used to have a setup where my developer account did not have the admin role. Sounds like a secure setup but I experienced only problems together with npm & sudo.
A temporary solution was to have a separate admin account and running all npm installs with this account, but that really sucks if you install a lot of packages.
After messing around for a while I finally uninstalled npm, upgraded my account with admin privileges and re-installed npm. No problems since then.

Resources