when i'm trying to update, iam getting error: Cannot find a valid baseurl for repo: remi-php74 - repository

[root#internalcrm ~]# yum update
Loaded plugins: etckeeper, fastestmirror, merge-conf
Repository 'remi-php74' is missing name in configuration, using id
Repository 'remi-php80' is missing name in configuration, using id
Loading mirror speeds from cached hostfile
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
Contact the upstream for the repository and get them to fix the problem.
Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
Run the command with the repository temporarily disabled
yum --disablerepo= ...
Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable <repoid>
or
subscription-manager repos --disable=<repoid>
Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
Cannot find a valid baseurl for repo: remi-php74

Related

NPM dependency from Gitlab directly

I have a situation where there was an update in one of npm packages I use in my project, but author didn't publish it on npmjs registry, so up to date code sits in gitlab only.
What would be the best solution to get updated version of code? I believe there is a way to add dependency to project which will be downloaded from gitlab or github public repository directly? Is it possible to compile it like in npmjs as well?
Yes, you could install a dependency from a git repository directly. As can be seen in the npm docs. You can straight install a Git Remote repository like this:
npm install <git remote url>
e.g.
npm install git://github.com/npm/cli.git
But beware that installing directly from the source git might have unintended side effects (missing build files, additional documentation files in general changes to the npmjs Version).
Also installing from the repository I would recommend you install from a specific commit/Tag.

npm ignores git+https setting and uses git+ssh in package-lock.json

We have multiple developers and an npm package that is installed form a public repository on github. while all developers usually have a github account, the CI server obviously doesn't (and usually doesn't need to).
The package from the public repository is installed using git+https://github.com/<author>/<repo>#<branch> however whenever a developer (with ssh installed) is installing another package the depencency in the package-lock.json is changed to git+ssh... which of course fails on the CI server.
is there any way to fix this behaviour?
Deleting the offending package-lock.json entry/reference and then running these two commands did the trick for me:
git config --global url."https://github.com/".insteadOf git#github.com:
git config --global url."https://".insteadOf git://
With credit to this article.

npm install fail with some package not found on some server

I am on different servers and run npm install
One server is ok. Another failed showing below error:
no matching version found for es-abstract#1.14.0
I tried npm ci. Same deal.
Then I did npm install es-abstract-1.14.0.tgz
But the size node_modules/ are different. I am using du -shc --apparent-size node_modules/ to ignore the sparse files within the folder. Why?
Could I accept that this is the network issue of the failed server? And just keep doing this? I mean, is the installation still going to be ok in this way?
At the time that this answer was written, there are 33 release versions for es-abstract on github, but only 32 release versions are listed on its npm registry. The missing version in the registry is 1.14.0.
Perhaps on one of your servers, you had this package cached (maybe it was previously listed on the NPM registry?, or maybe from downloading it from github?), and on the other server you did not have this package cached.
I had this same error message when trying to npm install a project from github.
In my situation, the es-abstract package was not explicitly listed in the package.json file, but it was a dependency of another package. Therefore I explicitly added it with the next highest version listed on the registry, and it worked.
e.g.
"dependencies": {
"es-abstract": "1.14.1",
...
Just a guess, but maybe 1.14.0 used to be listed on the registry, but now it's not?

Check if npm dependencies from pacakge.json are installed without network

How can I have npm tell me if all dependencies are already installed without checking the network?
My goal is to first test locally if anything needs to be installed, and then only if something is missing, I'll run a normal npm install to install it. I'm trying to avoid the initial check across the network though if everything is already there.
This is also given a package.json file with fixed versions, since obviously allowing auto upgraded packages would always require a remote repository check.
Update:
I've tested npm list which doesn't seem to access the network, and it prints out "UNMET DEPENDENCY" if something is in package.json but not installed. Is that the best way to accomplish this?
I'll probably end up with something like:
npm list | grep -c 'UNMET DEPENDENCY'
I'm not aware of anything that will explicitly tell you whether dependencies were installed from a remote repo or not. However I think that the shrinkpack package will help you achieve your aim.
Shrinkpack will cache your npm modules locally and only contact a remote repository when existing modules change or new modules are added.
I've used this in the past to reduce the number of network requests required for an npm install.

How can you invoke specific lifecyles of the npm install command?

I've got an irritating little bug with AWS, where I create my workspace (in this case, npm install) and distribute it to a bunch of slaves. Part of the install lifecycle for npm creates a bunch of symlinks in ./node_modules/.bin. Unfortunately, S3 doesn't support symlinks (see this question).
Now, it's a bit unfortunate that I'm downloading a prebuilt ./node_modules from S3, but it's how it's gotta be done (outside the scope of the question). When I run npm install on the slave, node doesn't recreate the symlinks.
I could always add a pretest hook to recreate the symlinks manually, but that's what got me wondering: is there a way to invoke specific parts of the npm lifecycle manually? If not, why? Running only parts of the install could be useful -- at least, here.