Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug?]: yarn command crashes after running "yarn config set cache-folder" #9075

Open
1 task
SpaceTimee opened this issue May 22, 2024 · 4 comments
Open
1 task
Labels

Comments

@SpaceTimee
Copy link

Self-service

  • I'd be willing to implement a fix

Describe the bug

After I ran yarn config set cache-folder by mistake, the cache-folder was set true, and almost any command of yarn crashed.

> yarn config set cache-folder
yarn config v1.22.21
warning package.json: No license field
success Set "cache-folder" to true.
Done in 0.68s.

> yarn cache dir
TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received type boolean (true)

> yarn cache clean
TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received type boolean (true)

> yarn
TypeError [ERR_INVALID_ARG_TYPE]: The "paths[1]" argument must be of type string. Received type boolean (true)

To reproduce

run yarn config set cache-folder

Environment

System:
  OS: Windows 11 10.0.22000
  CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
Binaries:
  Node: 20.7.0 - C:\Users\SPACET~1\AppData\Local\Temp\xfs-629213ed\node.CMD
  npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
  pnpm: 8.15.2 - C:\Program Files\nodejs\pnpm.CMD

Additional context

No response

@SpaceTimee SpaceTimee added the bug label May 22, 2024
@SpaceTimee
Copy link
Author

I got yarn back to normal by editing cache-folder in the .yarnrc file, but I think it could be better to return an error when such commands yarn config set cache-folder were typed.

@trivikr
Copy link

trivikr commented May 31, 2024

yarn config v1.22.21

This appears to be an issue with yarn classic which is frozen https://github.com/yarnpkg/yarn

@shinhanbyeol
Copy link

shinhanbyeol commented Jul 1, 2024

try remove .yarnrc file

I've been through something similar and removed the .yarnrc file to fix the problem.

It will happen again .yarnrc.

@clemyan
Copy link
Member

clemyan commented Jul 4, 2024

As noted, this is an issue with Yarn Classic. The Yarn Modern equivalent yarn config set cacheFolder true does not lead to an error.

@clemyan clemyan transferred this issue from yarnpkg/berry Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants