I'm doing this on a windows 10, without any VM software. I downloaded hyper and am using it to work with node and npm. On my laptop there's only 1 account(also the local account administrator). Despite this, I can't run most commands because I don't have the authority. In the error message it suggested to use sudo, but then on typing sudo it says bash: sudo: command not found
. How can I make npm and these other commands work?
Asked
Active
Viewed 1,063 times
0

Samarth Goyal
- 11
- 2
-
2Better add to your question, which _bash_ implementation are you using: WSL, Cygwin, Git-bash, ...? BTW, this is not a question for Stackoverflow. I suggest that you ask this on [su]. – user1934428 Nov 08 '21 at 10:23
-
I think I'm using WSL, because I needed it for Dockers. I'm not really sure because after downloading it I didn't do much to it. Also, what's the difference between Stack overflow and Super User? – Samarth Goyal Nov 11 '21 at 06:59
-
Basically, Stackoverflow is for discussing programming questions, Superuser is for using and configuring programs. But first of all, ensure that you **know** what environment you are using (for instance, WSL), and - in your case - which Dockers element you have. I'm not convinced that you really use a clean WSL, because WSL should have sudo in the usual location. But I don't know enough about WSL+Docker to assert this. – user1934428 Nov 11 '21 at 07:46
-
How can I check and make sure which environment I'm using? – Samarth Goyal Nov 13 '21 at 06:51
-
Well, usually people know what they have installed and use. A good starting point would be to do a `uname -a` and interpret its output. – user1934428 Nov 14 '21 at 09:22
1 Answers
0
There is no sudo
command in Windows. The nearest equivalent is run as administrator
You can do this using the run as a command with an administrator trust-level, or by right-clicking the program in the UI and choosing "run as administrator

Naveen
- 1
- 1
-
Is there a way to do this in CLI, I tried using run but it shows error and that it's not a command. – Samarth Goyal Nov 11 '21 at 07:01
-
@SamarthGoyal : I don't know whether this can be done in WSL without a lot of tweaking. For instance, the Cygwin people had (of course) the same problem, and it seems to be solved there by a [specific feature](https://stackoverflow.com/questions/4090301/root-user-sudo-equivalent-in-cygwin) of Cygwin. Even for you on WSL, I think it will be instructive to read the discussion under the accepted answer in that therad, because the idea to create an elevated console could possibly taken over to WSL as well. – user1934428 Nov 14 '21 at 09:15