Reputation: 341
I faced some issues with yarn. Thus uninstalled and reinstalled it via homebrew (mac). Now on running any yarn command getting the below error (even on yarn -v
)
Invariant Violation: Expected a key
at invariant (/usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:2314:15)
at Parser.parse (/usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:64434:55)
at parse (/usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:64581:21)
at module.exports.exports.default (/usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:64143:96)
at loadRcFile (/usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:56986:58)
at /usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:56960:14
at /usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:101468:14
at Array.map (<anonymous>)
at parseRcPaths (/usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:101466:78)
at Object.findRc (/usr/local/Cellar/yarn/1.22.15/libexec/lib/cli.js:101480:10)
Since none of the yarn commands are working not able to clear the yarn cache as well. How to resolve this issue?
Upvotes: 0
Views: 522
Reputation: 26
Ran into the same issue today, turns out it was caused by an empty string in the yarn.lock
file:
"@dockite/field@>= 1.1.14", "", "@dockite/field@^1.1.0","@dockite/field@^1.1.33":
Upvotes: 1