I installed yarn by
brew install yarn
i try
yarn dlx storybook@latest upgrade
result:
yarn run v1.22.22
error Command "dlx" not found.
info Visit
yarn add or yarn install working correctly
I installed yarn by
brew install yarn
i try
yarn dlx storybook@latest upgrade
result:
yarn run v1.22.22
error Command "dlx" not found.
info Visit https://yarnpkg.com/en
yarn add or yarn install working correctly
Share Improve this question asked Mar 14, 2024 at 16:14 GelloissGelloiss 1941 gold badge3 silver badges10 bronze badges 5 |4 Answers
Reset to default 5Since the point of yarn dlx
is to install a package within a temporary environment and no lock file or residuals artifacts are left behind, I just used npx
which does the same thing as dlx
and doesn't conflict.
No need to uninstall anything, just make sure you have the latest version of Yarn. For example, if you installed it with npm, first update Yarn, then set it to version 2, which is the Berry version, and that's it.
npm install -g yarn
yarn set version berry
You need to uninstall yarn again using brew and/or npm, depending on how you installed it. Then just enable corepack and you'll have access to the latest version of yarn. So run corepack enable
and you should be good to go.
If you need a specific global version of yarn you can then run corepack install --global [email protected]
or corepack install --global yarn@latest
etc.
Depending on your node version, and how you installed node, you might have to upgrade and/or install it manually by running npm install -g corepack
. But if you have a fairly recent install of Node, and your package manager isn't doing anything weird, you should be good
1.x
which doesn't have this command yarnpkg.com/getting-started/install – Konrad Commented Mar 14, 2024 at 16:20