Asked 6 years ago
4 Jan 2018
Views 1483
jessica

jessica posted

linux command run error in Window

installing Expo in pc , i run command

npm install exp --global

i got following error :


Does not seem like WSL enabled on this machine. In an admin powershell, please r
un:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-L
inux


so i start command prompt with Administrator mode
and run command

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-L
inux

but i got error that


 'Enable-WindowsOptionalFeature' is not recognized as an internal or external com
mand,
operable program or batch file.


so i stuck . what to do now ? is that secure to run command
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-L
inux
and what is this command do ? and why i got error on that ?
steave ray

steave ray
answered Apr 25 '23 00:00

If you need to run Linux commands on a Windows operating system, you may encounter issues as Linux commands are designed to be executed in a Unix-based environment. However, there are several options available to help you overcome this problem:

11.Virtual Machine: Install a Linux virtual machine on your Windows computer using software such as VirtualBox, VMware, or Hyper-V. Once the VM is up and running, you can execute Linux commands within it.

2.Windows Subsystem for Linux (WSL): This is a compatibility layer for running Linux binary executables natively on Windows. To use WSL, enable it in the Windows features menu, and then install a Linux distribution of your choice from the Microsoft Store. Once installed, you can run Linux commands directly in the WSL terminal.

3.Linux Emulator: You can use a Linux emulator like Cygwin or MSYS2 to create a Unix-like environment on Windows, which allows you to execute Linux commands and use Linux tools.

4.Third-Party Tools: There are several third-party tools available that allow you to run Linux commands on Windows, such as Git Bash, Babun, and Cmder.

Keep in mind that not all Linux commands may work on Windows, even with these options. It's also important to ensure that you are using the correct syntax and parameters for the command you want to execute
Post Answer