0

Some context: I've recently been trying to update a react native project that uses expo, since I have not worked on the project for about four months. I believe I finally was able to successfully upgrade the project as expo is starting. The issue is that I am now having some trouble with some of the newer modules I just installed with npm. This error seems to be coming from me not knowing how to use the commander module. Additionally, I do not believe that I have a thorough understanding of modulues in react native/expo. I am using ubuntu 20.04 via windows terminal.

Error: enter image description here

I did go to the website mentioned in the error. I believe that this link - https://github.com/tj/commander.js#avoiding-option-name-clashes - is what will solve my problem. However, I am confused as to where I should put the example file and how to use it.

I am not very well versed in modules for react native/expo and it is quite possible that I do not need to use this module (I thought that installing it would make my react native program run, but that does not seem to be the case).

Thus, I am looking for advice on either how to use this module, or on whether or not I should be using these modules (after updating node and then expo, the following modules could not be found every time I ran npm start, so I decided to install them using sudo npm install module_name -g since some other stackoverflow/github pages recommended that):

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

Any help would be appreciated, and I would be happy to provide any more information that would be relevant.

  • perhaps try setting `storeOptionsAsProperties` or `passCommandToAction` as in https://github.com/tj/commander.js/blob/master/examples/storeOptionsAsProperties-action.js – IronMan Dec 16 '20 at 00:47
  • @IronMan where would I put that file? Anywhere in my project? Does the name matter? – Alex Bishka Dec 16 '20 at 02:18

1 Answers1

0

I was not able to figure out a way to make the project work with the above modules. So, I followed the advice of a post I made on the expo forums (I posted similar context there and also the answer that I wrote below).

If you do not want to click the link, here are the steps below:

Basically, 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.