volta
volta copied to clipboard
`Volta error: Could not locate executable 'blitz' in your project.` even though blitz installed globally
I can not run blitz after installing it using yarn with the above error.
I uninstalled Volta, installed Volta again, and ran
$ volta install node
success: installed and set [email protected] (with [email protected]) as default
$ volta install yarn
success: installed and set [email protected] as default
$ yarn global add blitz
yarn global v1.22.17
...
[4/4] 🔨 Building fresh packages...
success Installed "[email protected]" with binaries:
- blitz
✨ Done in 76.55s.
$ blitz
Volta error: Could not locate executable `blitz` in your project.
Please ensure that all project dependencies are installed with `npm install` or `yarn install`
The system is an intel mac running macOs Big Sur 11.5.2.
Same here with the turbo
command from Turborepo.
@zayenz I believe once you use Volta, when you wanna install a global package, you should use volta install blitz
instead of installing it globally via yarn
or npm
.
@zayenz I think this may be a failure of our error messages. For background, the shims that Volta uses when you globally install something are context-aware. They detect when you're running in a project that depends on the same executable and use the project-local version (rather than the global version). See this blog post for some more info about how the package version is determined.
In this case, the error message is because it's trying to locate the project-local blitz
executable and not finding it in node_modules
. The suggested fix is to run npm install
or yarn
to populate the node_modules
directory. If you've done that, is it possible that you're using Yarn Plug'n'Play? This is actually the main outstanding issue we have with PnP behavior, see #158
I'm having the same issue with rimraf. I install it globally but when I try to run it outside any project I get a similar error.
interestingly enough, if I run just rimraf some-dir
it doesn't work, but if I run volta run rimraf some-dir
it works
@andrei9669 That's strange! It sounds like it may be a different issue since you're seeing failures when running outside of a project, rather than inside of one like this issue. Would you mind opening a new issue with that information and the full error message you're seeing?
@charlespierce sure: https://github.com/volta-cli/volta/issues/1145
Edit: it appears to me that I didn't run volta setup
and that's why I wasn't able to use those commands
Is this related to #1149?
In this case, it is happening to me with typescript (global) where I'm not able to run it by using the tsc executable but it works when is called from volta run tsc
https://github.com/expo/expo-cli/issues/4340
In my case, the project have pnpm
in devDependencies
, also restrict the installation to pnpm.
Volta will try to get locale pnpm, but it's not exist, so get this error. In this case, volta should use globally package.
Project: https://github.com/vitejs/vite
I have the same issue as @yoyo930021 for project formatjs: https://github.com/formatjs/formatjs/blob/main/package.json#L106
Same issue. any update?
Same issue with nx