Expo CLI requires installation after being installed (macOs) - macos

I am trying to run -npm start on my terminal but I get the notification This command requires Expo CLI with an option to install it globally. If I do this, I immediately get the same message with the same option to install Expo CLI even though it has just been installed. Is there a way to do something about it or work arround this issue?
My terminal looks like this now:
user#user-MacBook-Pro Project % npm start
> start
> expo start
This command requires Expo CLI.
Do you want to install it globally [Y/n]? y
Installing the package 'expo-cli'...
Expo CLI installed. You can run `expo --help` for instructions.
This command requires Expo CLI.
Do you want to install it globally [Y/n]? y
Installing the package 'expo-cli'...
Expo CLI installed. You can run `expo --help` for instructions.
This command requires Expo CLI.
Do you want to install it globally [Y/n]? y
Installing the package 'expo-cli'...
Expo CLI installed. You can run `expo --help` for instructions.
This command requires Expo CLI.
Do you want to install it globally [Y/n]?
I would appreciate any advice, thank you in advance!

Instead of installing Expo CLI via npm start, try to install Expo CLI separately first, then run npm start.
If the issue persists, try to run expo start directly instead of npm start, and see what it gives.

Related

Can I install Remix without using npx or npm?

I don't have permission to use npx on the shared server I'm using. Can I manually install react and remix?
If it's possible, where can I find instructions to do so?
You can just install create-remix manually, then execute the cli directly.
$ npm install create-remix
$ ./node_modules/.bin/create-remix my-remix-project

Expo client is not installing on Simulator

I have been using this setup for almost half a year now and I upgraded the Expo SDK to 44 (erased all content and settings on the simulator). Ever since, the expo client won't install on the simulator.
Things I have tried:
run expo client:install:ios
uninstall and reinstall expo
uninstall and reinstall watchman
tried different simulators (15.0 that I used so far)
creating a new blank expo project
open the simulator first and then npm start
I even did a complete MacBook reset (factory, needed to wipe anyway) and reinstalled following the expo documentation.
I read something about installing expo without sudo, but then it will throw errors and will simply not install.
New blank expo project infos:
Expo : 44.0.0
expo-cli: 5.0.3
react-native: 0.64.3
Hope someone knows the solution to this, I really want to get back programming.
I had the same problem. Turns out using sudo when installing expo-cli is the issue. Run the following commands to resolve it.
npm uninstall -g expo-cli
npm install -g expo-cli
Then from your Mac's user's directory in a new terminal, run the following:
mkdir apps
cd apps
expo init app-name
Once this finishes, it should work just fine after running npm start.
As #Mercify said, sudo was indeed the problem.
For future reference: if installing expo without sudo throws an error, it is nessecary to change "the owner" of the folder "/usr/.../node_modules" to your user.
This post helps changing the owner.
Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
Expo is now installing on the Simulator.
Thanks to #Mercify.

'web' is not recognized as an internal or external command operable program or batch file

I installed npm in my visual studio terminal and installed expo CLI but when i tried to npm start on my expo project it throws this error, can anyone tell me how to resolve this error, it would be of great help!
screenshot
expo start instead of npm start
Did you install the Expo CLI correctly?
according to documentation:
Verify that the installation was successful by running expo whoami.
You're not logged in yet, so you will see "Not logged in".
Installing Expo CLI

"exp: command not found" How do I add expo cli to path?

I installed the expo cli with
npm i -g exp
then I run
exp
and I get
-bash: exp: command not found
I'm guessing I didn't add exp to path. So how do I do this properly? Nothing I've tried so far works.
This suggested 3 steps solution worked for me:
First check if ~/.npm-global/bin is in your path: echo $PATH. If it isn’t there, you will need to add it to the path.
Open up ~/.bash_profile then add the following line to the bottom: export PATH=$PATH:~/.npm-global/bin
Finally, back in the shell, type: source ~/.bash_profile
Hopefully that will have fixed your problem.
1. Find the path where expo is globally installed by npm:
npm bin -g
2. Add path from Step 1 to paths file:
sudo vi /etc/paths
3. Restart the Terminal
You should try npx expo init <your_app_name> to test.
It worked for me.
I also had a hard time getting expo command to work on Mac. Here are the steps I took to get it working.
npm root -g shows the directory the global modules are installed in:
/usr/local/Cellar/node/11.7.0/lib/node_modules
That directory might be different for you. After confirming expo is in there, edit ~/.bash_profile and add the line:
export PATH=$PATH:/usr/local/Cellar/node/11.7.0/bin
Save & exit, then run source ~/.bash_profile
Now the expo command should function as intended.
try sudo npm install --global expo-cli
this worked for me.
➜ MobileDev git:(campaigns-responsive) ✗ expo whoami
› Not logged in, run expo login to authenticate
➜ MobileDev git:(campaigns-responsive) ✗ expo init App
✔ Choose a template: › blank a minimal app as clean as an empty canvas
✔ Downloaded and extracted project files.
📦 Using npm to install packages.
✔ Installed JavaScript dependencies.
✅ Your project is ready!
To run your project, navigate to the directory and run one of the following npm commands.
- cd App
- npm start # you can open iOS, Android, or web from here, or run them directly with the commands below.
- npm run android
- npm run ios
- npm run web
exp was replaced with expo
To install Expo CLI, just run npm install -g expo-cli (or yarn global add expo-cli, whichever you prefer).
Following on this issue, I found I had multiple global folders so I started using a .npm-global folder as shown here: https://docs.npmjs.com/getting-started/fixing-npm-permissions
And now it's all clean and in control.
I had a similar issue.
-bash: expo: command not found
It turns out the command to install expo
npm install -g expo-cli was referencing an older version of node on my machine; when checked using npm root -g.
So I had to uninstall nvm/node, deleted any remnant folders & files of .nvm and shortcuts for nvm in /usr/local. Then reinstalled node and ran npm install -g expo-cli again.
That fixed my issue.
sudo npm install --unsafe-perm -g expo-cli
If you're using git bash on windows, add npm path to your system path variables. Generally located on this location:
C:\Users\<Username>\AppData\Roaming\npm
Then open the bash and command npm start. Hope this will help.
I solved it by putting this in my PATH environment variable / user variable:
C:\Users\{userName}\node_modules\.bin
yarn expo start
Worked for me.
npx create-expo-app project-name

Grunt installation in windows

I am trying to install grunt in my system windows 7. I have downloaded grunt from github. When running grunt command its giving unrecognised command. Can anyone help me out in this?
You can install grunt globally via npm (downloading it from here https://nodejs.org/download/). Probably you will need to update your environmental variables (by adding '%USERPROFILE%\AppData\Roaming\npm' to $PATH) or simply restart your PC.
Then you should be able to run npm install -g grunt-cli from your PowerShell or Command Line. When the npm installation is ready you should have access to grunt command.

Resources