Yarn (Binary) Offline installation on Centos 7 - yarnpkg

How do i install Yarn (binary) offline on Centos 7. The machine doesn't have internet. Apologise if the question has been asked before.
I couldn't find it anywhere. All Questions point to using Yarn in offline mode but not how to install it offline at the first place.

Finally, i managed to do it via tarball (Note this is Linux installation).
You can install Yarn by downloading a tarball and extracting it anywhere.
cd /opt
wget https://yarnpkg.com/latest.tar.gz
tar zvxf latest.tar.gz
Yarn is now in /opt/yarn-[version]/
the following steps will add Yarn to path variable and run it from anywhere.
Note: your profile may be in your .profile, .bash_profile, .bashrc, .zshrc, etc.
Add this to your profile:
export PATH="$PATH:/opt/yarn-[version]/bin"
(the path may vary depending on where you extracted Yarn to)
In the terminal, log in and log out for the changes to take effect
To have access to Yarn’s executables globally, you will need to set up the PATH environment variable in your terminal. To do this, add
export PATH="$PATH:`yarn global bin`"
to your profile.
Here is the link i found it

Although Yarn can work in offline mode, the packages must be downloaded and stored in the in an offline mirror. Refer to this article.
Your Centos machine will need to be connected to another machine that has access to the Internet. The most common solution is to set up a http/https proxy, then set up yarn to use the proxy
yarn config set proxy http://proxy.server.com:8080
yarn config set https-proxy http://proxy.server.com:8080

Related

Yarn usage error: Couldn't find a configuration settings named "proxy"

I'm trying to update yarn proxy configurations but when I launch the command (I'm on Ubuntu 22.04)
yarn config set proxy my.proxy.url:port
I get the error
Usage Error: Couldn't find a configuration settings named "proxy"
All of this because I'm trying to run the yarn install command but all I get is package_name can't be found in the cache and will be fetched from the remote registry for a couple of packages.
I tried to curl some site and it works wonderfully, so it shouldn't be a shell problem (I'm using zsh by the way).

devspace behind coporate proxy

I am installing devspace in my local windows machine using npm
npm install -g devspace
after installed, it needs to Finish installation of DevSpace CLI, in which the following request is failed
Error requesting URL: https://github.com/devspace-cloud/devspace/releases/download/v5.1.0/devspace-windows-amd64.exe
I think it's because of my machine is using the company's proxy. However, I don't know how to config proxy in devspace (just like git, for example).
DevSpace maintainer here. Instead of using npm, you can also download the release binary manually from GitHub: https://github.com/devspace-cloud/devspace/releases/
You can just do this:
Download the devspace-windows-amd64.exe for a release
Rename the downloaded file to devspace.exe
Save the devspace.exe file in a folder (and add this folder to your PATH environment variable) => You may need to restart after changing the PATH variable
That's basically what the npm installer does as well but it seems like it is unable to download the binary from GitHub. This may be because of a proxy or because of anything related to GitHub (your company may hit the rate limit or something else).

gCloud SDK failed to install in macOS behind corporate proxy

I am trying to install gcloud SDK while using a coporate network which works behind a proxy (and a VPN sometimes). I get proxy settings automatically using a pac.fcgi file (Automatic Proxy Configuration).
Now when I try to run ./install.sh in the terminal, I am constantly getting the following error
➜ google-cloud-sdk ./install.sh
Welcome to the Google Cloud SDK!
To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. You may choose
to opt out of this collection now (by choosing 'N' at the below prompt), or at
any time in the future by running the following command:
gcloud config set disable_usage_reporting true
Do you want to help improve the Google Cloud SDK (Y/n)?
ERROR: (gcloud.components.list) Failed to fetch component listing from server. Check your network settings and try again.
I found this SO question which was having the same issue, but their problem was related to ipv6. I already have ipv6 disabled (I can't even enable it) and I am using ethernet to connect to the network. Thus the answer is not useful to me.
I searched for proxy related info about installation and found this page. It asks for using a non-interactive installer instead and using gcloud command to set the proxy after installation. My problem is that I can't even install gcloud. I have tried with both interactive and non-interactive installers.
Any way I can install gcloud while being behind a corporate proxy.
PS: I am on macOS High Sierra and using zsh shell (already tried bash), in case it matters.
So, the problem was I was unable to set proxy before installation of gcloud. The installation of gcloud basically set the CLI in the path and installs some required components (core, bq, gsutil etc).
So what I did is I added the following lines in my .zshrc
source <PATH to gcloud sdk>/google-cloud-sdk/path.zsh.inc
source <PATH to gcloud sdk>/google-cloud-sdk/completion.zsh.inc
or if you're using bash, add these lines in your .bashrc or .bash_profile
source <PATH to gcloud sdk>/google-cloud-sdk/path.bash.inc
source <PATH to gcloud sdk>/google-cloud-sdk/completion.bash.inc
After that I restarted the terminal (or just run source ~/.zshrc or source ~/.bashrc or source ~/.bash_profile on terminal)
Now I was able to use gcloud commands. I ran gcloud init, set the proxy and then installed the required components using the following command -
gcloud components install core bq gsutil
And I installed gcloud without using the install.sh script.
PS: Run scutil --proxy to know the proxy settings set in your system.
For Windows 10 users who experience this issue. I installed the google SDK from the archived versions page. then used git bash to install using ./google-cloud-sdk/install.sh. then added in environment variable manually to PATH to use commands.

Yarn keeps using old registry

I've been using yarn with a private registry in the past - however, the registry has now shut down and I want to use yarn with the official registry.
Whatever I do, yarn always seems to want to connect to the old registry and there's simply no way of making it use the new one. I've already tried:
Completely remove and re-install yarn
yarn config set registry https://registry.yarnpkg.com/
Verified that there is no mention of the old registry in either ~/.npmrc or ~/.yarnrc
Cleared the yarn cache using yarn cache clean
No matter what I do, yarn still tries to connect to the old registry on every install and I have no idea where yarn is getting that from...
any ideas?
Remove your global yarn.lock
rm ~/.config/yarn/global/yarn.lock
and then
yarn config set registry https://registry.yarnpkg.com/
Got it, the culprit was ~/.config/yarn/global/yarn.lock...
Running yarn add with --verbose will tell you which .yarnrc files are being picked up. These shouldn't include the old registry.
So run yarn add <your-package> --verbose and check the .yarnrc files found for any mention of the old registry.
In my case, I got it fixed with a rm ~/.npmrc running MacOS

How to Create a configuration File For MongoDB

I have installed mongodb for mac os through 10gen and I have gone through the documentation to do so. Everything seems fine apart from the configuration file. I can not see it in /etc/mongod.config. Do I have to manually create this config file? And if so how can I go about it?
cheers
The default path for brew installed mongodb on Mac OS X is /usr/local/etc/mongod.conf
Unless you have installed a packaged version of MongoDB (for example, using Homebrew or Mac Ports) you will have to create a config file manually, or just pass the appropriate command line parameters when starting up MongoDB.
If you want a commented example of a config file to start with, the mongodb.conf in the Debian/Ubuntu package should be a good starting point. Important options to check are the dbpath and logpath which will likely be different for you.
It would also be worth looking at the Homebrew mongodb formula which includes setting up a LaunchAgent script to manage the mongod service.
Yes, unless you install via a package manager (like apt or yum on Linux) you have to create this manually. Then, When you start mongod you simply need to specify where the config file is, for example:
./mongod -f /path/to/mongod.conf
For how that file should look, just take a look here:
http://docs.mongodb.org/manual/reference/configuration-options/
You can also see the aforementioned Linux config files from the packages on github:
https://github.com/mongodb/mongo/blob/master/rpm/mongod.conf
https://github.com/mongodb/mongo/blob/master/debian/mongodb.conf
In the case you installed MongoDB without Homebrew, i.e. downloaded the TGZ package directly from MongoDB Download Center, you will can add the configuration file:
sudo nano /etc/mongod.conf
Please use only spaces (no tabs) in the file and leave a space after the key. For example:
security:
authorization: enabled
net:
port: 27017
bindIp: 0.0.0.0
And then run the instance with the configuration flag:
mongod -f /etc/mongod.conf
I wrote a post about installing MongoDB Community Edition directly from the TGZ archive.

Resources