26

This happens when I run expo install expo-permissions

It explicitly returns me

Installing 1 SDK 35.0.0 compatible native module using Yarn.

yarn add expo-permissions@~7.0.0

spawn yarnpkg ENOENT

Set EXPO_DEBUG=true in your env to view the stack trace.

Which is strange because I don't normally use Yarn. I use NPM to install dependencies.

I know this error has to do with my files or some path not being configured correctly. What I don't know is which path it is that I have to change and how to do so.

Please let me know if there is any other relevant info that I should add here.

Community
  • 1
  • 1
Wilfredo Casas
  • 419
  • 2
  • 6
  • 14

8 Answers8

41

I had the same problem as you my solution and you perform the installation of yarn via npm:
npm i -g yarn
I believe this error is caused because he cannot find the symbolic link for yarnpkg. When executing this command, yarn will be updated and linked.

22

You can just pass the flag --npm after the command.

expo install [package-name] --npm
  • 2
    That´s the best answer because you don´t have to install Yarn to solve the problem. Just add the arg --npm to the command and all went fine. works with "expo update --npm" too. – tirmey Nov 07 '20 at 02:59
11

Best solution for this would be using --npm flag

Example:

expo install pkname --npm,
expo update --npm,
expo upgrade --npm,

This is happened because you haven't executed yarn install or yarn command.

Malakai
  • 3,011
  • 9
  • 35
  • 49
Deepak Meena
  • 111
  • 1
  • 3
9

Yes, I tried many ways and finally, I found the solution. The issue was different yarn package version. So first of all, you need to upgrade yarn version lastest.

open terminal and type the following.

  1. npm install --global yarn

  2. expo update

Hope this solve your issue.

Sheng Li
  • 119
  • 2
  • 4
3

I had a similar problem. You should install yarn in your system, since that's what Expo CLI is trying to execute to install packages. For me my issue was that I did had yarn but I had an old version. I had to update my yarn version to 1.19.0. If you install this version it should work correctly.

I recommend using yvm to install and manage different versions of yarn. After you install yvm it is as easy to install yarn as yvm install <version>, so in this case you would do yvm install 1.19.0. And if you ever have to change versions because another project doesn't work with 1.19.0 (sometimes it happens) you can just install another version and change between versions by doing yvm use <version>.

Hope this helps!

Mauricio
  • 839
  • 2
  • 13
  • 26
1

This worked for me:

Latest Yarn Installation (from here)

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt update && sudo apt install yarn

sudo apt update && sudo apt install --no-install-recommends yarn

Add this to your profile: export PATH="$PATH:/opt/yarn-[version]/bin" (the path may vary depending on where you extracted Yarn to) In the terminal, log in and log out for the changes to take effect

yarn --version checks if the version is latest (1.0+).

Then expo update <version> (ex: 36.0.0)

Concideration: Do not forget to check if you give attention to similar warning: "warning package-lock.json found. Your project contains lock files generated by tools other than Yarn."

Giorgi Gvimradze
  • 1,714
  • 1
  • 17
  • 34
0

"spawn yarnpkg ENOENT" usually indicates that the system cannot find the "yarnpkg" command.

npm i -g corepack

This worked for me.

ogncmn
  • 1
0

For nextjs you can try this as I found out that I am npx not yarn same as how I start npx expo start

npx expo update
Max
  • 1
  • 2