volta
volta copied to clipboard
`volta run yarn` works under Node 18.14, does nothing under Node 18.15, 18.16
Platform:
- macOS 13.4.1
- Volta 1.1.1, installed via Homebrew
Notes:
- Normally, I just run
yarn
. I'm runningvolta run yarn
here so I can pass the--verbose
flag for more debugging info. - This used to work for me. I'm not sure why it stopped working. It works for my coworkers in the same repo. Is there anything else I can do to help debug?
Works with Node 18.14.0
$ volta pin [email protected]
success: pinned [email protected] (with [email protected]) in package.json
$ volta run --verbose -- yarn run asdf
[verbose] Found default configuration at '/Users/kannan/.volta/tools/user/platform.json'
[verbose] [email protected] has already been fetched, skipping download
[verbose] [email protected] has already been fetched, skipping download
[verbose] Active Image:
Node: 18.14.0 from project configuration
npm: 9.3.1 from project configuration
pnpm: None
Yarn: 1.22.19 from project configuration
Usage Error: Couldn't find a script named "asdf".
$ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...
[verbose] No custom hooks found
Doesn't seem to actually run Yarn when I set the Node version to 88.15.0
$ volta pin [email protected]
success: pinned [email protected] (with [email protected]) in package.json
$ volta run --verbose -- yarn run asdf
[verbose] Found default configuration at '/Users/kannan/.volta/tools/user/platform.json'
[verbose] [email protected] has already been fetched, skipping download
[verbose] [email protected] has already been fetched, skipping download
[verbose] Active Image:
Node: 18.15.0 from project configuration
npm: 9.5.0 from project configuration
pnpm: None
Yarn: 1.22.19 from project configuration
[verbose] No custom hooks found
Same as above with Node 18.16.0
$ volta pin [email protected]
success: pinned [email protected] (with [email protected]) in package.json
$ volta run --verbose -- yarn run asdf
[verbose] Found default configuration at '/Users/kannan/.volta/tools/user/platform.json'
[verbose] [email protected] has already been fetched, skipping download
[verbose] [email protected] has already been fetched, skipping download
[verbose] Active Image:
Node: 18.16.0 from project configuration
npm: 9.5.1 from project configuration
pnpm: None
Yarn: 1.22.19 from project configuration
[verbose] No custom hooks found
Also, just noticed that I get a non-zero exit code:
$ volta run --verbose -- yarn
[verbose] [email protected] has already been fetched, skipping download
[verbose] [email protected] has already been fetched, skipping download
[verbose] Active Image:
Node: 18.16.1 from project configuration
npm: 9.5.1 from project configuration
pnpm: None
Yarn: 1.22.19 from project configuration
[verbose] No custom hooks found
$ echo $?
126
$ which -a yarn
/Users/kannan/.volta/bin/yarn
$ yarn
$ echo $?
1
Yarn internally uses V8's code cache. Maybe a stale cache is causing problems. The v8-compile-cache package explains how to clear and disable it. Could be worth a try.
@cakoose Did you ever get to the bottom of this? I'm experiencing something similar - however only in a child folder. Reinstalling volta didn't seem to help.
No, I never found the issue, but it mysteriously started working again some time later so I haven't looked into it further.
@ide mentioned v8-compile-cache, so maybe that's a place to start? One idea is to try deleting Yarn's v8-compile-cache folder, though I'm not sure where that is 🤔
Maybe run yarn
under a syscall tracing tool to see what files it accesses? Could use strace
on Linux/BSD or dtruss
/ktrace
on MacOS. (Probably important to passing in the options to ensure any child processes are also traced.)
I actually found deleting my .yarnrc.yml file made it work again - but there was nothing obviously wrong in it.
@jinder: Interesting!
The ".yarnrc.yml" file does have the Yarn berry version, e.g.
yarnPath: .yarn/releases/yarn-3.5.0.cjs
So maybe deleting it and re-running Yarn caused it to download a new version, which may have invalidated any old cached data?
Try rm -fr "$TMPDIR/v8-compile-cache-*"
.
IME a source of these problems is due to mismatches between Intel and Apple silicon software, namely Homebrew and Volta itself. If you've migrated your macOS setup from an Intel computer to an Apple silicon one, I've found it helpful to completely delete Homebrew and Volta and the software they've installed, and then reinstall them.
Mine occurred on a Windows-only setup. My guess is it's something to do with Yarn's own version pinning which doesn't really play that well with Volta.