Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

/usr/bin/env: ‘bash ’: No such file or directory

This is a line endings issue, but not from Ubuntu. Make sure you do have node and npm installed correctly by using the command:

sudo apt install nodejs npm

Then stop Windows path variables being shared with WSL by editing the /etc/wsl.conf file in WSL. If the file doesn't exist, execute sudo touch /etc/wsl.conf first. Edit the file with the command sudo nano /etc/wsl.conf and add the following configuration:

# Wsl.conf
[interop]
appendWindowsPath = false

Then restart WSL2 with command wsl --shutdown in Windows(Powershell or CMD).
Comment

/usr/bin/env: ‘bash ’: No such file or directory

# The error message suggests that the script you're invoking has embedded 
 characters,
# which in turn suggests that it has Windows-style 
 line endings instead of the 
-only
# line endings bash expects.
# As a quick fix, you can remove the 
 chars. as follows:
sed $'s/
$//' ./install.sh > ./install.Unix.sh
Comment

env: sh : No such file or directory

Go inside android directory and run:
dos2unix ./gradlew
Comment

/usr/bin/env: ‘ruby ’: No such file or directory

<!--If you are working on a Unix based system like Ubuntu/Mac, then this error is because you have incorrect line endings.
Set your line endings correctly, and have git manage how it handles them:-->
git config --global core.autocrlf input

<!--In your work directory convert all of the files by running:-->
find ./ -type f -exec dos2unix {} ;
Comment

/usr/bin/env: bash No such file or directory

Docker on Windows: /usr/bin/env: bash
 No such file or directory
Getting the following error when you want to start your Docker container on Windows: /usr/bin/env: bash
 : No such file or directory

[edit]
I discovered that another fix is to do dos2unix <file>

dos2unix <file with the issues>
Try that if you’re on Windows or working with others who work on Windows.

[/edit]
I found several topics with several fixes. But what fixed it for me was:

Solution: Setting the line-endings correctly

In my editor: 

In git: git config --global core.autocrlf false
I chose the 
 line ending as this is stated in PSR-12: 2.2 Files:
All PHP files MUST use the Unix LF (linefeed) line ending only.

I use PHPStorm and had to go to
Settings > Editor > Code Style > tab General > Unix and macOS (
)


NOTE: you may have to do the following to fix files with the wrong line-endings:

remove the built Docker image on Windows: first list docker images and then delete: docker rmi <imagename>
fix the line-ending of the file. You might do that by removing the newline and adding a new one. Don’t forget to save, commit and push
Comment

/usr/bin/env: ‘bash ’: No such file or directory

sed $'s/
$//' ./install.sh > ./install.Unix.sh
Comment

PREVIOUS NEXT
Code Example
Shell :: ls with file size 
Shell :: Not Found - GET https://registry.npmjs.org/boostrap-vue - Not found 
Shell :: *15856 connect() to unix:/var/run/php/php8.0-fpm.sock failed (11: Resource temporarily unavailable) 
Shell :: cisco copy running config 
Shell :: list all files by size 
Shell :: Ubuntu open terminal in current folder with shortcut 
Shell :: # Check failed: allocator-SetPermissions(reinterpret_cast<void*(region.begin()), region.size(), PageAllocator::kNoAccess). 
Shell :: .nvm bash 
Shell :: Looping over a file lines in bash 
Shell :: git pull from another repository 
Shell :: free todo linux 
Shell :: install ionic version 
Shell :: stop port 
Shell :: how to install bootstrap in angular 
Shell :: django shell get db info 
Shell :: vim code highlighting mac 
Shell :: give all users access to root folder 
Shell :: How to use Github Personal Access Token in Jenkins 
Shell :: print colored text bash 
Shell :: gh create github repo 
Shell :: npm install bootstrap 3 
Shell :: nvm remove node version 
Shell :: ffprobe number of frames 
Shell :: get total installed List from ubuntu terminal 
Shell :: Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 
Shell :: Kali - How to Uninstall Software on Kali Linux 
Shell :: reload fstab 
Shell :: rmdir not empty 
Shell :: pynacl pip install 
Shell :: docker delete container and image 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =