yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.73k forks source link

Can't run yarn at all #9052

Open joseandresgavilanes opened 5 months ago

joseandresgavilanes commented 5 months ago

Self-service

Describe the bug

I'm trying to run yarn but it doesn't work. I already tried to install it again and moved between node versions but the same error appears over and over again no matter the yarn command I run. I tried using npm to install it and via the installer. This problem is happening globally not only in projects.

YAMLException: end of the stream or a document separator is expected at line 1, column 1:

^
at generateError (C:\Program Files (x86)\Yarn\lib\cli.js:126022:10)
at throwError (C:\Program Files (x86)\Yarn\lib\cli.js:126028:9)
at readDocument (C:\Program Files (x86)\Yarn\lib\cli.js:127394:5)
at loadDocuments (C:\Program Files (x86)\Yarn\lib\cli.js:127430:5)
at load (C:\Program Files (x86)\Yarn\lib\cli.js:127451:19)
at safeLoad (C:\Program Files (x86)\Yarn\lib\cli.js:127473:10)
at parse (C:\Program Files (x86)\Yarn\lib\cli.js:63707:18)
at module.exports.exports.default (C:\Program Files (x86)\Yarn\lib\cli.js:63258:96)
at loadRcFile (C:\Program Files (x86)\Yarn\lib\cli.js:56992:58)
at C:\Program Files (x86)\Yarn\lib\cli.js:56966:14

To reproduce

Yarn [something]

Environment

yarn dlx -q envinfo --preset jest
YAMLException: end of the stream or a document separator is expected at line 1, column 1:

    ^
    at generateError (C:\Program Files (x86)\Yarn\lib\cli.js:126022:10)
    at throwError (C:\Program Files (x86)\Yarn\lib\cli.js:126028:9)
    at readDocument (C:\Program Files (x86)\Yarn\lib\cli.js:127394:5)
    at loadDocuments (C:\Program Files (x86)\Yarn\lib\cli.js:127430:5)
    at load (C:\Program Files (x86)\Yarn\lib\cli.js:127451:19)
    at safeLoad (C:\Program Files (x86)\Yarn\lib\cli.js:127473:10)
    at parse (C:\Program Files (x86)\Yarn\lib\cli.js:63707:18)
    at module.exports.exports.default (C:\Program Files (x86)\Yarn\lib\cli.js:63258:96)
    at loadRcFile (C:\Program Files (x86)\Yarn\lib\cli.js:56992:58)
    at C:\Program Files (x86)\Yarn\lib\cli.js:56966:14

Additional context

Using Windows OS

Daniel15 commented 4 months ago

Do you have an empty .yarnrc file somewhere on your system? Try delete it.