0

when I run the flutter doctor command or other flutters command on ubuntu it works fine.. but when I switch to root user with

sudo su

then I run

flutter doctor

then it throws an Error

Command 'flutter' not found, but can be installed with:
snap install flutter

I don't know why this happening can some one help me to find actual problem thanks in advance ..

5
  • Have you checked these procedures for the path? Commented Apr 20, 2021 at 13:20
  • yes.. i have added the path in .bashrc file Commented Apr 20, 2021 at 13:22
  • and working fine without root when i switch to root user it gives error Commented Apr 20, 2021 at 13:23
  • 1
    Now that I realize you are using root, by default the user's bashrc is not accessed by the root, protection mechanism, you will have to create a specific bashrc for root. In this post he talks about bashrc for root. Commented Apr 20, 2021 at 13:51
  • thank You bro.. got it.. its really helped me now I've added same path of flutter in root bashrc file now its running thank you for responding !! :) Commented Apr 21, 2021 at 0:54

1 Answer 1

2

as @Chance helped me to add flutter path in root bashrc file i have added flutters path in /etc/bash.bashrc file and now its working in root user also.. thx again @Chance

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.