segmentation fault or bus error shown on iterms2 when running yarn

7.5k Views Asked by At

enter image description here

whenever I run yarn start/ yarn install / or any sort of method relating yarn won't work.

however, npm does work. How do I fix this problem?

I've tried to downgrade the node.js version but it won't work.

4

There are 4 best solutions below

2
이병우 On

I think it's a permission issue. Try adding the "sudo" prefix to the command

0
Dmitry On

I got positive result adding "sudo" right before command:

npm install --global yarn

Like this:

sudo npm install --global yarn

And yarn was successfully installed.

1
Nayan Gaikwad On

Check the node version if it is older than LTS then consider updating the node.

0
Loopy On

I had to start running npx yarn instead of just yarn after I upgraded to node 18 for some reason.