Open YingchenWang007 opened 1 year ago
Hi @YingchenWang007, sorry about the delayed response here. Did you get this figured out? I have not seen a case where volta list
finds a local copy of a tool in a package but is unable to run it, but that sounds like a super annoying bug.
If you are still having this issue, (a) do you have a repository we can look which it consistently reproduces with, and (b) can you confirm that you ran npm install
or yarn install
in the package and that it is executable at node_modules/.bin/tsc
or similar?
I had this issue as well, I was trying to run globally installed zx in a project directory that had zx in package.json without running npm install
first cause it would take a long time due to huge amount of packages.
My temporary solution was to only install zx in the project:
npm install --no-package-lock --no-save zx
Then running zx
worked.
But a better solution would be to have a flag or env variable for volta to make it use the global version of a tool:
VOLTA_USE_GLOBAL=1 zx
Or maybe by default if the tool is not in node_modules run the global tool.
volta list
⚡️ Currently active tools:
See options for more detailed reports by running
volta list --help
.tsc
Volta error: Could not locate executable
tsc
in your project.taro
Volta error: Could not locate executable
taro
in your project.Please ensure that all project dependencies are installed with
npm install
oryarn install