0

I have the expo-cli working fine on Windows with a project initialized and running which I'd like to be able to do on this machine. However, on Mac, it keeps saying that the package is getting updated but when I try running expo init or the expo command globally it doesn't work:

/Users/daggerpov/.npm/bin/expo -> /Users/daggerpov/.npm/lib/node_modules/expo-cli/bin/expo.js
/Users/daggerpov/.npm/bin/expo-cli -> /Users/daggerpov/.npm/lib/node_modules/expo-cli/bin/expo.js
+ expo-cli@4.11.0
updated 2 packages in 94.007s
daggerpov@Daniels-MBP ~ % expo
zsh: command not found: expo

Also, I get a bunch of deprecation warnings but I've heard it's expected by installing this through npm, nevertheless here's the full output:

daggerpov@Daniels-MBP ~ % npm install -g expo-cli
npm WARN deprecated graphql-tools@3.0.0: This package has been deprecated and now it only exports makeExecutableSchema.\nAnd it will no longer receive updates.\nWe recommend you to migrate to scoped packages such as @graphql-tools/schema, @graphql-tools/utils and etc.\nCheck out https://www.graphql-tools.com to learn what package you should use instead
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated uuid@3.0.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
/Users/daggerpov/.npm/bin/expo -> /Users/daggerpov/.npm/lib/node_modules/expo-cli/bin/expo.js
/Users/daggerpov/.npm/bin/expo-cli -> /Users/daggerpov/.npm/lib/node_modules/expo-cli/bin/expo.js
+ expo-cli@4.11.0
updated 2 packages in 94.007s

What I've done to try resolving the issue of not being able to use the expo command has been:

  • installing Watchman through homebrew (it had no errors and came out fine)
  • running cd ~/node_modules && npm i expo-cli && sudo npm i -g expo && sudo npm i --global expo-cli
  • I followed this YouTube tutorial which said to run npm install expo-cli global which resulted in this:
daggerpov@Daniels-MBP ~ % npm install expo-cli global
(just some of the same deprecation warnings)
npm WARN checkPermissions Missing write access to /Users/daggerpov/node_modules/expo-cli
npm WARN daggerpov@1.0.0 No description
npm WARN daggerpov@1.0.0 No repository field.

npm ERR! code ELOOP
npm ERR! syscall access
npm ERR! path /Users/daggerpov/node_modules/expo-cli
npm ERR! errno -62
npm ERR! ELOOP: too many symbolic links encountered, access '/Users/daggerpov/node_modules/expo-cli'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/daggerpov/.npm/_logs/2021-09-10T06_57_31_944Z-debug.log

Perhaps since my node version is a little more recent than the LTS it could pose a problem?

daggerpov@Daniels-MBP ~ % node --version
v14.8.0
daggerpov@Daniels-MBP ~ % npm --version
6.14.8

UPDATE: I've changed my node version to the LTS and have made sure that usr/local/bin is in $PATH but this did not fix the issue.

daggerpov@Daniels-MBP ~ % echo $PATH
/Users/daggerpov/.pyenv/shims:/Library/Frameworks/Python.framework/Versions/3.9/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
daggerpov@Daniels-MBP ~ % node --version
v14.17.6
Daggerpov
  • 127
  • 1
  • 13
  • Try some older node versions with n -> https://github.com/tj/n or nvm. – Michael Bahl Sep 10 '21 at 07:12
  • I've installed nvm by following what was outlined in this issue: https://gist.github.com/mike-casas/6d489bebf48d89f5109cd1395aabe150 then I ran `nvm install node` and it gave me v16.9.0. I will update the question or post an answer if this leads me to solve the issue. – Daggerpov Sep 10 '21 at 08:50

1 Answers1

0

I've installed nvm by following what was outlined in this issue: then I ran nvm install node and it gave me v16.9.0. Then, I ran npm install --global expo-cli as I did before and the expo command now runs fine.

Important note: The expo command would only work right after using the nvm install node command so when I went to VSC I had to use that before every session. I will try to find a solution to this issue and edit this answer accordingly. So, this is how you configure your node version using nvm and have it stay. Personally, I did nvm use 16.9.0 then when I checked my node version it saved.

Daggerpov
  • 127
  • 1
  • 13