How to get pnpm store directory - pnpm

Is there any way how to check directory/path of pnpm store?
I know you can set it with npm config set store /path/to/.pnpm-store, but npm config get store in my case returns undefined, which I guess means to pnpm to use some default, but where can I find this default value?

Nowadays you can do
pnpm store path
which, according to pnpm's documentation:
Returns the path to the active store directory.
The default locations of the store are:
If the $XDG_DATA_HOME env variable is set, then $XDG_DATA_HOME/pnpm/store
On Windows: ~/AppData/Local/pnpm/store
On macOS: ~/Library/pnpm/store
On Linux: ~/.local/share/pnpm/store
Related docs: https://pnpm.io/npmrc#store-dir

Seems like as of v3.0.1, you cannot get it. pnpm should probably update pnpm get store so that it returns the default location.
As of v3, the pnpm store is located at ~/.pnpm-store by default.
You could also open the file node_modules/.modules.yaml in your project. It will contain a field called "store" with the location of the store that was used to hardlink packages to your project.
Update 2022:
As of v7, refer to #renardesque's or #nouvist's answer's below.

previously, pnpm store is located on user home folder.
Linux : ~/.pnpm-store
Windows : C:\Users\YOUR_NAME\.pnpm-store
macOS : ~/.pnpm-store
but from now on (v7.0.0), pnpm store is located on different folder. it will located on $XDG_DATA_HOME on Linux, and %LOCALAPPDATA% on Windows. take a look to this issue.
Linux : ~/.local/share/pnpm/store (default)
Windows : C:\Users\YOUR_NAME\AppData\Local\pnpm\store
macOS : ~/Library/pnpm/store
or, you can check where is located with pnpm store path command

Possible locaiton:
~/.pnpm-store
If project is on the same partition as user home.
$partition_root/.pnpm-store
If project is on different partition as user home.
Why not just use ~/.pnpm-store:
On linux/mac, pnpm use hard link to reuse file.
And hard link, can be created only on the same partition.

Related

how to configure cygwin Local Package Directory

I have to change my cygwin Local Package Directory, which happen to be earlier as C:\Users\username\Downloads.
Folders like http%3a%2f%2fcygwin.mirror.constant.com%2f are all in place in my new directory for Local Package Directory.
How to do that? (I cannot find, where cygwin stores the config.)
Running setup from new location tries to install all over again instead from continue using earlier packages from the internet.
The information is on /etc/setup/setup.rc
$ head setup.rc
last-cache
e:\downloads\cygwin_cache
last-mirror
http://mirrors.kernel.org/sourceware/cygwin/
net-method
Direct
last-action
Download,Install
mirrors-lst
....
Please note that setup just propose the settings based on last run but you can always change typing new values.

Where files are allocated in Parse Server?

I'm implementing an instance of Parse Server, I want know where the Parse Server Allocated the files ?
According to File Adapter, the default file storage is GridFS in mongodb.
Depends on the operating system and type of installation you used.
If installed on a linux/unix using the global install npm install -g parse-server mongodb-runner then your parse-server files will normally be under usr/lib/node_modules/parse-server. ( may differ from linux versions )
be careful when editing these files for hot hacks or modifications. If you later choose to upgrade parse-server they will be overwritten.
Your cloud file directly is normally created by you. So this could be home/parse/cloud/main.js. This can be in any location of your choice. To set a new location you will set that in the index file or json (depending on your startup process ).
cloud: '/home/myApp/cloud/main.js', // Absolute path to your Cloud Code
If you installed not using the global install, then obviously you would need to cd to where you cloned the project.
Windows would be similar. Clone (or download the zip) parse-server from the repo. Open a console window and “cd” to the folder where you have cloned/extracted the example server, eq:
cd "C:\parse-server"
Here is where the files will sit on the parse-server. Hopes this helps!

How do I configure Composer to use a different path on Windows when my Application Data folder is remote?

When I install composer on Windows 10, with active directory (meaning some of my user files live off on a server elsewhere), I get the following error when attempting to install:
Installation failed, deleting ./composer.json.
[InvalidArgumentException]
$from (\AD.LOCAL\SYSTEM\Users[path]\Application Data\Composer\ad.local\system\Users[path]\Applicat
ion Data\Composer\vendor\bin/boris) and $to (\AD.LOCAL\SYSTEM\Users[path]\Application Data\Composer\vendor
[path]\boris\bin\boris) must be absolute paths.
...very likely because my "Application Data" folder is not on my local machine.
How can I get around this. Windows composer install doesn't give me much in the way of options.
(Or, alternately, if I'm misinterpreting the cause of the problem, what is actually going on and how do I fix it?)
If your issue was during the installation there is a flag that allows you to set the installation directory.
The bin file from the path in the error message vendor/bin/boris doesn't look familiar to me and I am going to assume you completed an installation and a command had failed. There is a COMPOSER_HOME environment variable that impacts where a number of items are stored. This defaults to ${APPDATA}/Composer, if there are issues writing under that path for any reason, you can change the path by setting the COMPOSER_HOME variable for your user.
Created a local windows admin account, installed the functions from that account, and then put the local admins roaming folder in my PATH. Ugly, but effective.

clion change default cache directory

Currently, for linux operating systems, the cache and index folders for clion are defaulted to /home/.Clion12/. I am on an NFS and want the cache directory and indexing directories to point to my internal ssd. Where can I change this?
I just found the answer to this. In the bin directory where clion.sh is kept, there is an ideas.properties file. You can change the default location there.
As #StevenCombs said, the file idea.properties is in the same bin directory where clion.sh is found, and the variable is idea.system.path.
I set it up like this. First, on the command line I did:
sudo mkdir -p /var/cache/mlakata
sudo chown mlakata /var/cache/mlakata
And then in the ${clioninstall}/bin/idea.properties file, I added
idea.system.path=/var/cache/mlakata/CLion/system
CLion appears to populate the CLion/system directories under my personal cache directory.
The problem was solved for me after I have created an idea.properties file in ~/.Clion2019.2/config then populated it with:
# custom CLion properties
idea.config.path=/someFolder/my_work/clion_ws/.Clion2019.2/caches/trunk-config
idea.system.path=/someFolder/my_work/clion_ws/.Clion2019.2/caches/trunk-system
idea.plugins.path=/someFolder/my_work/clion_ws/.Clion2019.2/caches/trunk-plugins
After this, the cache is build in /someFolder, not flooding my home folder anymore.
Official support page for path parameters

How do I change the default location of mongodb?

I installed MongoDB on Yosemite using brew. I understand that the default storage location is /data/db. I'd like to change this to location /Volumes/Data/mongodb, so that when I run 'mongod', it will choose the databases in /Volumes/Data/mongodb by default. I tried editing the mongod.conf file, and I have
storage:
dbPath: /Volumes/Data/mongodb
However, whenever I run 'mongod', it gives me the message:
ERROR: dbpath (/data/db) does not exist.
Create this directory or give existing directory in --dbpath.
See http://dochub.mongodb.org/core/startingandstoppingmongo
If I give mongod the --dbpath argument, it works fine, but I want it to work by default. Why does it appear that my mongod.conf file is not obeyed. Searching on google, it seems the conf file in installed in different locations depending on OS and install method. Running db.serverCmdLineOpts() gives:
{
"argv" : [
"/usr/local/opt/mongodb/bin/mongod",
"--config",
"/usr/local/etc/mongod.conf"
],
"parsed" : {
"config" : "/usr/local/etc/mongod.conf",
"net" : {
"bindIp" : "127.0.0.1"
},
"storage" : {
"dbPath" : "/Volumes/Data/mongodb"
},
"systemLog" : {
"destination" : "file",
"logAppend" : true,
"path" : "/usr/local/var/log/mongodb/mongo.log"
}
},
"ok" : 1
}
Notes
The path must exist. It doesn't get created automagically.
/Volumes is sort of a reserved directory for mounting drives and bundles and shouldn't be worked on directly.
In case you use a volume or (sparse) bundle, you need to make sure it is mounted on boot or you have to do it manually before starting MongoDB.
Basically, there are two places to put MongoDB data in OS X. Sadly, neither brew nor MacPorts obey the File Hierarchy Standard*, which is also adopted by the BSD which is the foundation of OS X.
Solution 1: You want the data accessible by all users of OS X
Since mongod is run from /usr/local subtree, so this is our parent. But since variable data belongs to /var we need to use the local tree there. So our base path for the data is /var/local/lib. It is mongoldb data, so you can either put it into mongo (because of the package basename) or mongodb (because of the vendor name) or even mongod (because of the daemon name). That's basically a matter of taste, but I'd stick with the vendor. So your dbpath would be /var/local/lib/mongodb.
Solution 2: Only you will access the data
Put the data into your home directory.
Well, basically you can do what you want there, but in general I'd put data into a hidden directory (prefixed with a dot) so that it does not clutter your Finder. Something like $HOME/.mongodb
This solution isn't really clean, since the software will run from a public subtree and the data is stored in a user directory.
Extension to both solutions
If you want to put your data into a volume or (sparse) bundle, simply create a symlink from the correct location to the volume, simply create a symlink instead of creating a directory. Example for solution 1:
sudo ln -s /Volumes/YourVolume /var/local/lib/mongodb
* Well, it is to argue that since MacPorts installs under /opt, it technically does (though imho it would rather belong to /usr/local in the first place)
AFAIK, mongod needs to be configured before working. There are 2 ways to specify configurations.
by command line arguments. which is the --dbpath parameter you added. for example:
mongod --dbpath /Volumes/Data/mongodb
by specifying a config file. Usually if you install from source, it comes with one at /etc/mongod.conf (varies depends on different Linux distributions). Where you can specify all the parameters in it.
By saying
I want it to work by default
I assume you mean you want to start daemon on system reboot. So the config file you are actually using is specified in the daemon script. For example in CentOS you can find daemon script in /etc/init.d/mongod, where the line
CONFIGFILE="/etc/mongod.conf"
decides which config file you are using. So you may want to find your daemon script and check it first.
If this is not your situation, maybe you just downloaded mongodb from somewhere and unzipped it to your system, and you start mongodb with nothing but:
mongod
This way I guess the default location of mongod.conf is decided by the compiling parameters. Which means if you want to change it, you'll have to download the source code and compile it yourself.

Resources