Problems with updating project modules

This is my first time posting, so I apologize in advance if I am doing something wrong (like wrong section of the forum or missing details, happy to follow up with an edit).

I am having some problems updating an existing project (I stopped working on it about 4 months ago and now I would like to return to it). At first I was having issues with expo being out of date, but I believe I resolved that problem by first updating node to a more recent version and then updating expo to a more recent version.

My current issue seems to be the following six modules:

  1. fs-extra
  2. terminal-link
  3. chalk
  4. getenv
  5. commander
  6. @expo/xdl

The issue with them is that after updating expo I would get this error after I ran the command npm start: Error: cannot find module_name (where module name is a filler for the six above). After looking through some stack overflow posts and google searches I decided to just npm install them globally.

Now, I do not know if I should or should not have done that, but I was just trying to get my project to run. My current issue (after installing all six of those modules) is this:

I see that the commander module is having some issue with name clashing, but I have no idea what this means. I tried to read though the github repo and readme, but I am confused. I believe the answer to my problem is in this section. Furthermore, I should be using a file like so.

However, I do not understand what any of this is doing and I tried to create that file in the root folder of my project, but that did not seem to work, so I am just quite lost here.

I guess I am looking for help in terms of whether or not I should be using those modules. If I should be, then how do I proceed with the error I am currently getting? If I should not be using those modules, should I downgrade expo or something? I’ve been struggling with this for a few days now and I feel like I’m quite out of my depth here.

Let me know if any error logs, versions, or any other information would be useful and I will happily follow up.

Hey @python123, the modules you listed are dependencies of expo-cli and shouldn’t be included in an expo project you create. I would recommend a blank slate approach by uninstalling all things expo-related, clearing your caches and then re-installing expo-cli globally. Once that’s successfully re-installed, create a new project with expo init and then fire it up.


Thanks Adam, I’ll give that shot and later update the post on how it went.

So I got things to work again! Your idea worked just fine, so I appreciate it a lot Adam.

I uninstalled expo using the following command: npm -g uninstall expo-cli --save && yarn global remove expo-cli. Then I proceeded to remove the .expo folder from my home directory. More details on these two steps can be found here.

After that, I reinstalled expo using npm install --global expo-cli, from the expo documentation, in the install section.

Then I closed my terminal, reopened it, and ran expo whoami. The command returned recommending an update, so I followed the provided update command (which I believe was just npm install --global expo-cli again).

I closed the terminal, reopened it, and ran expo whoami again. This time I was just met with “you are not logged into expo” (or something along those lines). So, everything seemed up to date.

I then went to project and ran npm start and it worked fine.

Note: You may need to use sudo for any uninstall and install commands above (your terminal will likely tell you if you do).

Note Clearing cache for npm and yarn may take some time. Additionally, the first time you run npm start may also take some time. I’d say all in all this took about two to three hours, but my computer is also not the best.

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