Discovering the location of binary dependencies with zero installations is made easy using1:
// Obtain the path to the binary for [name]
yarn bin [name]
You can also view a list of available binaries in yarn by simply running yarn bin
without specifying a name
. Adding the -v
flag displays the binary names alongside their associated packages. (refer to the "Examples" section below for more details)
Next, utilize the node
command in yarn2, as shown below:
yarn node [path/to/name/bin]
Examples
(currently, I'm on [email protected])
yarn bin eslint
to locate path:
yarn bin eslint
/path/to/binary/.yarn/berry/cache/eslint-plus-stuff.zip/node_modules/eslint/bin/eslint.js
eslint -h
using
yarn node [path from above command]
:
yarn node /path/to/binary/eslint-plus-stuff.zip/node_modules/eslint/bin/eslint.js -h
eslint [options] file.js [file.js] [dir]
Basic configuration:
--no-config-lookup Disable look up for eslint.config.js
...
yarn bin
without package name:
$ yarn bin
YN0000: eslint
YN0000: puppeteer
YN0000: tsc
YN0000: tsserver
YN0000: vc
YN0000: vercel
YN0000: eslint-config-prettier
YN0000: next
YN0000: webpack
YN0000: Done in 0s 14ms
yarn bin
without package name but with -v
flag:
$ yarn bin -v
YN0000: eslint eslint@npm:9.0.0
YN0000: puppeteer puppeteer@npm:22.6.3
YN0000: tsc typescript@patch:typescript@npm%3A5.4.5#optional!builtin<compat/typescript>::version=5.4.5&hash=5adc0c
YN0000: tsserver typescript@patch:typescript@npm%3A5.4.5#optional!builtin<compat/typescript>::version=5.4.5&hash=5adc0c
YN0000: vc vercel@npm:33.7.1
YN0000: vercel vercel@npm:33.7.1
YN0000: eslint-config-prettier eslint-config-prettier@npm:9.1.0 [0cdeb]
YN0000: next next@npm:14.1.4 [0cdeb]
YN0000: webpack webpack@npm:5.91.0 [0cdeb]