nvm icon indicating copy to clipboard operation
nvm copied to clipboard

[alpinelinux] ls: unrecognized option: q

Open zaoqi opened this issue 6 years ago • 4 comments

zaoqi avatar Jun 07 '19 15:06 zaoqi

Please fill out the entire issue template.

ljharb avatar Jun 07 '19 20:06 ljharb

Also getting this problem in Windows 10: WSL: Alpine.

❯ which npm
/home/<MYUSER>/.nvm/versions/node/v12.18.1/bin/npm

❯ nvm use 12
ls: unrecognized option: q
BusyBox v1.31.1 () multi-call binary.

Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]...

List directory contents

        -1      One column output
        -a      Include entries which start with .
        -A      Like -a, but exclude . and ..
        -x      List by lines
        -d      List directory entries instead of contents
        -L      Follow symlinks
        -H      Follow symlinks on command line
        -R      Recurse
        -p      Append / to dir entries
        -F      Append indicator (one of */=@|) to entries
        -l      Long listing format
        -i      List inode numbers
        -n      List numeric UIDs and GIDs instead of names
        -s      List allocated blocks
        -lc     List ctime
        -lu     List atime
        --full-time     List full date and time
        -h      Human readable sizes (1K 243M 2G)
        --group-directories-first
        -S      Sort by size
        -X      Sort by extension
        -v      Sort by version
        -t      Sort by mtime
        -tc     Sort by ctime
        -tu     Sort by atime
        -r      Reverse sort order
        -w N    Format N columns wide
        --color[={always,never,auto}]   Control coloring
ls: unrecognized option: q
BusyBox v1.31.1 () multi-call binary.

Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]...

List directory contents

        -1      One column output
        -a      Include entries which start with .
        -A      Like -a, but exclude . and ..
        -x      List by lines
        -d      List directory entries instead of contents
        -L      Follow symlinks
        -H      Follow symlinks on command line
        -R      Recurse
        -p      Append / to dir entries
        -F      Append indicator (one of */=@|) to entries
        -l      Long listing format
        -i      List inode numbers
        -n      List numeric UIDs and GIDs instead of names
        -s      List allocated blocks
        -lc     List ctime
        -lu     List atime
        --full-time     List full date and time
        -h      Human readable sizes (1K 243M 2G)
        --group-directories-first
        -S      Sort by size
        -X      Sort by extension
        -v      Sort by version
        -t      Sort by mtime
        -tc     Sort by ctime
        -tu     Sort by atime
        -r      Reverse sort order
        -w N    Format N columns wide
        --color[={always,never,auto}]   Control coloring
N/A: version "12 -> N/A" is not yet installed.

You need to run "nvm install 12" to install it before using it.

nvm debug

❯ nvm debug
nvm --version: v0.35.3
$SHELL: /bin/zsh
$SHLVL: 1
${HOME}: /home/<MYUSER>
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v12.18.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Program Files (x86)/Intel/iCLS Client/:/mnt/c/ProgramData/Oracle/Java/javapath:/mnt/c/Program Files/Dell/DW WLAN Card:/mnt/c/Program Files/Intel/iCLS Client/:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Program Files/WIDCOMM/Bluetooth Software/:/mnt/c/Program Files/WIDCOMM/Bluetooth Software/syswow64:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Microsoft VS Code/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Users/<MYUSER>/scoop/apps/gsudo/current:/mnt/c/Users/<MYUSER>/scoop/shims:/mnt/c/Users/<MYUSER>/AppData/Local/Microsoft/WindowsApps:${HOME}/bin
$PREFIX: ''
${NPM_CONFIG_PREFIX}: ''
$NVM_NODEJS_ORG_MIRROR: 'https://unofficial-builds.nodejs.org/download/release'
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.7.1 (x86_64-alpine-linux-musl)'
uname -a: 'Linux 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 Linux'
OS version: Welcome to Alpine Linux 3.11
curl: /usr/bin/curl, curl 7.67.0 (x86_64-alpine-linux-musl) libcurl/7.67.0 OpenSSL/1.1.1d zlib/1.2.11 nghttp2/1.40.0
wget: unrecognized option: V
BusyBox v1.31.1 () multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
        [-o|--output-file FILE] [--header 'header: value'] [-Y|--proxy on/off]
        [-P DIR] [-S|--server-response] [-U|--user-agent AGENT] [-T SEC] URL...

Retrieve files via HTTP or FTP

        --spider        Only check URL existence: $? is 0 if exists
        -c              Continue retrieval of aborted transfer
        -q              Quiet
        -P DIR          Save to DIR (default .)
        -S              Show server response
        -T SEC          Network read timeout is SEC seconds
        -O FILE         Save to FILE ('-' for stdout)
        -o FILE         Log messages to FILE
        -U STR          Use STR for User-Agent header
        -Y on/off       Use proxy
wget: /usr/bin/wget,
git: /usr/bin/git, git version 2.24.3
grep: /bin/grep, BusyBox v1.31.1 () multi-call binary.
awk: /usr/bin/awk, BusyBox v1.31.1 () multi-call binary.
sed: /bin/sed, BusyBox v1.31.1 () multi-call binary.
cut: /usr/bin/cut, BusyBox v1.31.1 () multi-call binary.
basename: /usr/bin/basename, BusyBox v1.31.1 () multi-call binary.
rm: /bin/rm, BusyBox v1.31.1 () multi-call binary.
mkdir: /bin/mkdir, BusyBox v1.31.1 () multi-call binary.
xargs: /usr/bin/xargs, BusyBox v1.31.1 () multi-call binary.
nvm current: v12.18.1
which node: ${NVM_DIR}/versions/node/v12.18.1/bin/node
which iojs: iojs not found
which npm: ${NVM_DIR}/versions/node/v12.18.1/bin/npm
npm config get prefix: ${NVM_DIR}/versions/node/v12.18.1
npm root -g: ${NVM_DIR}/versions/node/v12.18.1/lib/node_modules

airtonix avatar Jun 20 '20 03:06 airtonix

I think this is an issue with alpine not having a proper posix ls, and wget, to name a few. I'm not sure how to fix it.

ljharb avatar Jun 20 '20 07:06 ljharb

I think this is an issue with alpine not having a proper posix ls, and wget, to name a few. I'm not sure how to fix it.

Correct. If you install coreutils, you will have proper ls, wget, awk, ... packages:

apk add coreutils

Source: https://wiki.alpinelinux.org/wiki/How_to_get_regular_stuff_working

krisztianodor avatar May 25 '22 18:05 krisztianodor