DEV Community

Installing Yarn on WSL

Bonnie Simon on December 11, 2020

So I had my harddisk formatted and had to redo all my WSL dev environment setup. I went to the yarn website to install yarn, and was left confused...
Collapse
 
shayelbaz1 profile image
Shay Elbaz •

I GET THIS ERROR?

node:internal/modules/cjs/loader:928
throw err;
^

Error: Cannot find module '/mnt/c/Users/User/C:\Users\User.yarn\releases\yarn-1.22.10.cjs'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Function.executeUserEntryPoint as runMain
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Collapse
 
tharushindewangi profile image
TharushiNDewangi •

how you fix it

Collapse
 
ondrovic profile image
ondrovic •

I had the same issue until I closed the terminal I was working in and reopened it.

Collapse
 
ahnerttt profile image
Ahnert •

Thanks so much!

Collapse
 
grayxu profile image
Gray Xu •

works for me. thx!

Collapse
 
codewithankur profile image
ANKUR SHARMA •

great work for me

Collapse
 
ndukachukz profile image
ndukachukz •

Nice and straight forward

Collapse
 
ichavezf profile image
Eduardo Chavez •

thanks man

Collapse
 
harbinder_singh_015039dd1 profile image
Harbinder Singh •

Here is the way to install using npm:
npm install --global yarn

Collapse
 
bluesky1992web profile image
Ali Ibrahim •

amazing man Thank you !

Collapse
 
despertaweb profile image
Lou Rectoret •

You made my day ^^

Collapse
 
codedbychavez profile image
Chavez Harris •

This worked perfectly. Many thanks Bonnie.