sindresorhus / global-directory

Get the directory of globally installed packages and binaries
MIT License
74 stars 10 forks source link

Support Pnpm? #16

Open tunnckoCore opened 4 years ago

tunnckoCore commented 4 years ago

For what I'm seeing is that we only need to change the packages part. The thing is that I don't know for now what's it on Windows.

exports.npm.packages = path.join(npmPrefix, isWindows ? 'node_modules' : 'lib/node_modules');

exports.pnpm.packages = path.join(npmPrefix, isWindows ? 'TODO' : 'pnpm-global/3/node_modules');

The rest is the same as the npm's

zvictor commented 1 year ago

Pnpm keeps growing in popularity, and having support to it here would be ideal.

Is it correct to say that all we are missing here is the location of global packages when running Windows?

doinkythederp commented 1 year ago

I think packages are located at $PNPM_HOME/global/5/node_modules. For context, PNPM_HOME is usually set to ~/AppData/Local/pnpm/. I've got this information from a fresh install of pnpm using the powershell installer command on https://pnpm.io. I then unzipped a new node.js archive into the same directory as pnpm.exe because it needs node installed to install packages.

peterroe commented 3 months ago

Is there any progress here?