Reputation: 141
I'm creating a react app, using command
create react-app new-app
but it's not creating a new app until i change this command to
sudo create react-app new-app
.
After this if I try to install any dependency using npm then also I have to include sudo in the beginning of every command. And also sometimes the project files are not accessible by code editor as they get locked .
please help me to get rid of this sudo ...
Upvotes: 0
Views: 2736
Reputation: 31
You can get rid of specifying "sudo" everytime using sudo -s
command.
If no command is specified after passing de "-s" argument to "sudo", an interactive shell is executed, you will not need to specify sudo again in this session.
Upvotes: 1
Reputation: 140
Sudo used to stand for "Superuser do" It simply means that your operating system thinks that you don't own the directory. You can use this command to resolve the issue: chown [username]:[username] -R
. chown is short for "Change Owner".
Here's a trick you could use in the future - incase you have to execute the previous command using sudo
you can punch in sudo !!
and this will run the previous command as root
.
So how that would work is:
some command
- Doesn't run and you need sudo. sudo !!
- executes sudo some command
automatically.Best wishes :)
Upvotes: 1