Impossible to upgrade eas-cli version

Hello everyone,

Impossible to upgrade eas-cli, whatever I do.

Any idea ?

Thanks a lot !
screenshot eas cli

Hi @boostarz

What happened when you ran npm install -g eas-cli?

Hi @wodin

Nothing special. The package seems to install normally. But thatā€™s not the case.
Iā€™ve never been able to update eas-cli.
I used this syntax: npx eas-cli to always use the latest version. But since I use the SDK 48, this trick no longer worksā€¦

you probably installed eas-cli using another copy of node whose global node modules directory takes precedence (appears first in PATH). try to find where that eas-cli installation is (on macos this would be ā€œwhich eas-cliā€) and remove it

Then brents is right that you have two copies installed. You are upgrading one copy, but then running the other one.

Try running echo %PATH%
Then start looking in each directory listed in the path for eas (I suppose on Windows it would probably be eas.bat or eas.ps1 or something like that). If you go through them in order, the first one you find is the one you are running.

Itā€™s possible that the version of npm that you are running is not installing binaries to a location that is in your path. Try running npm config --global get prefix. On Linux or macOS there would be a bin directory in the prefix directory and that is where npm installs the binaries. On Windows, Iā€™m not sure if the directory will be called bin. But if you look in the subdirectories of the prefix for eas.* then check if that directory is included in your PATH, and if itā€™s not, add it.

Yes @brents @wodin thereā€™s two versions but I am unable to find the right path.
I will try your method @wodin
I will let you know !
Thanks a lot for your replies :pray:

1 Like

Well @brents @wodin I cannot find old version of eas-cli. The most recent is easily found but impossible to find the old one. I have more or less tried everything. Until I erased from my machine (I use Windows) all files similar to eas-cli and reinstalled everything. Nothing to do.
In this case, I have this problem since I use the local expo-cliā€¦:unamused:

Please check if you have eas-cli listed in your dependencies or devDependencies in package.json?

Also, please tell me what you get if you run: npm config --global get prefix
And what does that directory contain?

And: echo %PATH%

Hi @wodin

Sorry for the delay (very busy!)

No eas-cli is not listed in package.json

echo %PATH% givesā€¦ %PATH% :neutral_face:

When I run config ā€“ global the path is : C:\Users\m_aur\AppData\Roaming\npm
where the last version of eas-cli is installed (4.1.2)

But I have another eas-cli (and Expo) file here : C:\Users\m_aur\AppData\Local
the version is 3.18.3

Even if I delete everything, everything is reinstalled in the same place.

I still wonder how I can solve this problem.

I looked at comments in which other developers had the same problem and the solution was to remove the duplicates. But in my case, it doesnā€™t work!!
I do not really know what else to doā€¦
In any case, thank you for your help Wodin :+1:

Sorry, that would have worked in CMD.EXE, but in PowerShell apparently you would have to do this:

echo $env:path

Do you mean you have files called something like the following?

C:\Users\m_aur\AppData\Local\eas.bat (or .cmd or .exe etc.)
C:\Users\m_aur\AppData\Local\expo.bat (or .cmd or .exe etc.)

I assume the eas.* file is in a subdirectory of the above npm directory. Sorry, I donā€™t have a Windows box with npm installed that I can check myself.

What happens if you add the above directory at the start of your PATH?

e.g. on Windows 10 you should be able to open the Settings app and type ā€œenvā€ into the ā€œFind a settingā€ search box. If you choose either of the ā€œyour accountā€ or ā€œsystemā€ options it will open a window with the user and system environment variables.

Youā€™ll probably see a ā€œPathā€ environment variable in both user and system sections. When you open a new PowerShell session, the PATH will contain first the System version of the PATH followed by the user version of the PATH. So in order to make sure that npmā€™s global binary directory is first in the PATH you would need to put it at the start of the System ā€œPathā€ environment variable and add a semicolon to separate it from the rest of the directories on the PATH.

Then open a new PowerShell session and try eas --version.

Hi @wodin

Yes indeed it works better with echo $env:path (see screenshot)
No, the files I find on this path: AppData\Local do not have the extension bat or cmd or exe (see screenshot)
Then I followed your instructions butā€¦ I donā€™t see how to correct the problem. As a general rule, I never touch Windows settings - unless I have no choice!
Iā€™ll keep looking but in the meantime Iā€™m forced to use an backdated version of eas-cliā€¦

Anyway thanks for your help!



Hi, I have a similar problem. After I used ā€œwhich easā€, I then removed the directory with ā€œrmā€ keyword before the path and then installed eas cli globally in my project still Iā€™m having errors. If I run eas build:configure, I will get no directory or file path found. if I run eas whoami, no directory or file path found. kindly help

OK, so I see the path contains:

  • Python/Java/Windows/powershell/ssh/.Net/SQL Server/PuTTY/Git stuff
  • Node.js
  • More Windows stuff and VS code and mongosh
  • And finally, npm.

Iā€™ve just got hold of a Windows 10 VM and installed Node 18 on it. It automatically added an entry to the end of the user PATH that is the same as the one at the end of your PATH (except for the username).

At first, that directory did not exist.
Then I ran npm i -g eas-cli
After that, the directory did exist and contained the following:

PS C:\Users\user> dir $env:APPDATA\npm


    Directory: C:\Users\user\AppData\Roaming\npm


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        2023/08/31     15:21                node_modules
-a----        2023/08/31     15:21            318 eas
-a----        2023/08/31     15:21            330 eas.cmd
-a----        2023/08/31     15:21            825 eas.ps1


PS C:\Users\user>

If I run npm config -g get prefix, I get the following:

PS C:\Users\user> npm config -g get prefix
C:\Users\user\AppData\Roaming\npm

So as far as I can see, on this VM, the AppData\Roaming\npm directory is the one you want. But something before it in the path has another copy of eas. (Maybe C:\Program Files\nodejs?)

If you canā€™t find where this other copy of eas is, I would edit your PATH to put C:\Users\m_aur\AppData\Roaming\npm at the start of the system path instead of at the end of the user path.

Same problem here. The workaround is to run with npx.

npx eas-cli -v
eas-cli/5.0.2 win32-x64 node-v18.17.1
npm list -g
C:\Program Files\nodejs -> .\
ā”œā”€ā”€ eas-cli@5.0.2
ā””ā”€ā”€ npm@9.6.7
eas -v
ā˜… eas-cli@5.0.2 is now available.      
To upgrade, run npm install -g eas-cli.
Proceeding with outdated version.      

eas-cli/3.8.1 win32-x64 node-v18.17.1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.