Could not resolve hostname github.com: Name or service not known - npm

Started receiving the error; Could not resolve hostname github.com: Name or service not known after updating our npm version from 6.14.14 to 8.1.2 when trying to run npm publish against our private package to our private registry.
Our package.json is configured with "private": true and we have also configured our private registry in a local .npmrc file on the build server.
> npm publish dist/{{project}}
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git#github.com/dist/{{project}}.git
npm ERR! ssh: Could not resolve hostname github.com: Name or service not known
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
Why is this updated version of npm trying to publish to github.com?
Switching the build agent target back to the 6.14.14 install does not try to publish out to github.com and successfully publishes it to our private registry.

Related

How to add public bitbucket repo in package.json or bower.json

I have a library pushed on bitbucket as public repo. I want its link to used in package.json dependencies object. I have tried various https formats but not one is working.
"library_name": "https://username#bitbucket.org/repo_name.git"
"library_name": bitbucket://bitbucket.com/username/repo_name.git
"library_name": "bitbucket#bitbucket.com:username/repo_name.git#master
Or I can add it in bower.json? I don't want to use it directly like npm install repo_url
The error I get is something like
ECMDERR Failed to execute "git ls-remote --tags --heads https://username#bitbucket.org/dv.keystone.git", exit code of #128 remote: Not Found fatal: unable to access 'https://username#bitbucket.org/reponame.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
remote: Not Found
fatal: unable to access 'https://username#bitbucket.org/repo_name.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
Update:
"lib_name": "https://username#bitbucket.org/team_name/repo_name.git"
It works in bower.json but I need this in package.json to work. If I use it in package.json, it gives this error
npm ERR! addLocal Could not install /tmp/npm-16628-b0121d64/git-cache-cbc9eb1e/7c4c6a5fb3e77723f3866c99fdf0825ba7cc0c5c
npm ERR! Linux 4.13.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v6.12.3
npm ERR! npm v3.10.10
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall read
npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.
Did some googling for you - as I wasn't sure myself.
This may work for you:
git+https://bitbucket.org/{user}/{repo}.git
I do not know how to add BitBucket modules in package.json. The way I do add github repo as,
"library-name": "git+https://github.com/user/library-name.git"
So to think about just replacing the github part it should be
"library-name": "git+https://bitbucket.org/user/library-name.git"

npm install host key verification failed

I ran npm install in angular2+ project directory and got below error which I cannot understand at all.
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\bin\git.EXE ls-remote -h -t ssh://git#bitbucket.org/path/projectname.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
I have created ssh key on bitbucket and account and saved it on drive. |
I have clone project from bitbucket.
What does this error has to do with that?
As I am new on project so don't have much knowledge.
Do I need to provide ssh key while npm install as well?
Please let me know if I can provide more info related to question.
Thanks!
Please check the npm version that you are using. Npm comes bundled with node and you shouldn't have multiple instances on your classpath.
Hey yup, I thought as much, but seeing as I had updated npm to the
latest version ( I even uninstalled node and reinstalled ) with the
same result. npm -v still showed the same version - 1.4.9.
FYI for others that may have the same issue. I also have Chocolatey
installed, and it seems that npm was also installed via Chocolately
which seems to overide the npm path. Uninstalling npm from Chocolately
resolved the npm version issue.
After that angular/cli installs correctly from npm.
https://github.com/angular/angular-cli/issues/6313#issuecomment-301360623

How to install mfpdev-cli to offline environment?

I am trying to setup offline (does not have internet access) OS X machine for MobileFirst Platform 8.0 development, and failing to install MobileFirst CLI.
I am referring to this article.
I have installed 8.0.0.0-MFPF-DevKit-MacOSX-IF2016080923.zip on the offline machine, then run.sh and console.sh.
Development server has successfully launched, and now I can access to Operations Console.
I have downloaded mfpdev-cli.tar from the Console, and followed the article I cited above.
Copy mfpdev-cli.tar to online machine.
On the online machine, npm --cache ./.cache install mfpdev-cli.tar
Archive .cache directory, and copy the archive file to the offline machine.
On the offline machine, unarchive .cache directory.
sudo npm install --cache ./.cache ./mfpdev-cli.tar -g
Then, I got below:
npm ERR! fetch failed https://registry.npmjs.org/http-proxy/-/http-proxy-1.13.2.tgz
npm WARN retry will retry, error on last attempt: Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
Those ERR! and WARN repeats for many other packages.
And at last:
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--cache" "./.cache" "./mfpdev-cli.tar" "-g"
npm ERR! node v4.5.0
npm ERR! npm v2.15.9
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo
npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is 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! Please include the following file with any support request:
npm ERR! /Users/babatch/Downloads/mfpdev-cli/npm-debug.log
How do I install mfpdev-cli on offline machine?
The problem is that npm is attempting to contact its online repository still due to some file dependency on the http-proxy package.
What you can do is to get/add this dependency independently and then try again.
I have tried some methods, and finally it got working.
The procedure is below:
On the online machine, npm install ./mfpdev-cli.tar (without -g)
cd node_modules
tar -cvzf mfpdev-cli.tgz mfpdev-cli and copy mfpdev-cli.tgz just created to the offline machine.
On the offline machine, tar -xvzf mfpdev-cli.tgz
sudo cp -r mfpdev-cli /usr/local/lib/node_modules
cd /usr/local/bin
sudo ln -s ../lib/node_modules/mfpdev-cli/bin/cli.js ./mfpdev
At present, it seems to be working fine.

Stencil CLI Installation Hiccup

Ran into a small hiccup when attempting to install the stencil CLI on my machine running Ubuntu 14.04. I will attach the contents of the error below. At this point, I've been able to verify that npm, and node are installed correctly and I've been able to verify that I have the correct GitHub permissions by confirming my ability to access https://github.com/bigcommerce-stencil/stencil-cli. Any insight would be appreciated.
dante#Ubuntu:~$ sudo npm install -g bigcommerce-stencil/stencil-cli
[sudo] password for dante:
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Cloning into bare repository '/home/dante/.npm/_git-remotes/git-github-com-bigcommerce-stencil-stencil-cli-12bc62b4'...
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Permission denied (publickey).
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli fatal: Could not read from remote repository.
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli Please make sure you have the correct access rights
npm ERR! git clone git#github.com:bigcommerce-stencil/stencil-cli and the repository exists.
npm ERR! addLocal Could not install bigcommerce-stencil/stencil-cli
npm ERR! Error: ENOENT, stat 'bigcommerce-stencil/stencil-cli'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! npm-#googlegroups.com
npm ERR! System Linux 3.16.0-57-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "bigcommerce-stencil/stencil-cli"
npm ERR! cwd /home/dante
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path bigcommerce-stencil/stencil-cli
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/dante/npm-debug.log
npm ERR! not ok code 0
I might also add that I've verified that npm is also installed on my machine as it is bundled w/ the node installation. I feel as if this is something that I'm easily overlooking.
This is due to the closed source code. You need to go through the early access dev flow and add your SSH keys, etc. Should resolve it.

react-native init AwesomeProject unable to connect to github.com

I followed the tutorial posted by facebook. Getting startted https://facebook.github.io/react-native/docs/getting-started.html#content
however, when I run react-native init AwesomeProject, I only get the following errors. My node.js is v4.1.0, npm is v2.14.3.
I don't know if my environment is ok or it just can not connect to github.com?
npm ERR! git clone --template=/Users/jansenli/.npm/_git-remotes/_templates --mirror git://github.com/facebook/react.git /Users/jansenli/.npm/_git-remotes/git-github-com-facebook-react-git-baa2986b: fatal: unable to connect to github.com:
npm ERR! git clone --template=/Users/jansenli/.npm/_git-remotes/_templates --mirror git://github.com/facebook/react.git /Users/jansenli/.npm/_git-remotes/git-github-com-facebook-react-git-baa2986b: github.com[0: 192.30.252.129]: errno=Operation timed out
npm ERR! Darwin 14.5.0
npm ERR! argv "/Users/jansenli/.nvm/versions/node/v4.1.0/bin/node" "/Users/jansenli/.nvm/versions/node/v4.1.0/bin/npm" "install" "--save" "react-native"
npm ERR! node v4.1.0
npm ERR! npm v2.14.3
npm ERR! code 128
npm ERR! Command failed: git clone --template=/Users/jansenli/.npm/_git-remotes/_templates --mirror git://github.com/facebook/react.git /Users/jansenli/.npm/_git-remotes/git-github-com-facebook-react-git-baa2986b
npm ERR! Cloning into bare repository '/Users/jansenli/.npm/_git-remotes/git-github-com-facebook-react-git-baa2986b'...
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 192.30.252.129]: errno=Operation timed out
npm ERR!
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! /Users/jansenli/AwesomeProject/npm-debug.log
npm install --save react-native failed
First - check if you can actually see github website at all. Just go to https://github.com/facebook/react and you should see the react project. If you can see, that's already good :).
The error messages indicate however that you have problem with downloading the repo via git://github.com/facebook/:react.git. You can validate that by running:
git clone git://github.com/facebook/react.git
It should hang and you should get timeout as well.
If you cannot connect with git:// and if at the same time you can connect to github via https - my wild guess is that you have firewall blocking git protocol via port 9418 connections to github (more about the git protocol here: https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols#The-Git-Protocol). You get timeout, which is pretty standard behaviour if you are behind company firewall.
If that's the case, then there are few options. First - bypass the firewall - like do it from home or something ... If you cannot do it however, then you can try to let git always use https:// instead of git://. Apparently those two commands will configure git in this way (I have not tried it, but it should work):
git config --global url."https://github.com/".insteadOf git#github.com:
git config --global url."https://".insteadOf git://
Likely only the first command should be enough (but I am not 100% sure if it is).