nvm-sh / nvm

Node Version Manager - POSIX-compliant bash script to manage multiple active node.js versions
MIT License
80.01k stars 8.01k forks source link

nvm uninstall does not work #1653

Open nepaul opened 7 years ago

nepaul commented 7 years ago
nvm --version: v0.33.6
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/zsh
$HOME: /Users/nibo
$NVM_DIR: '$HOME/.nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.3 (x86_64-apple-darwin17.0)'
uname -a: 'Darwin 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64'
OS version: Mac 10.13 17A405
curl: /usr/bin/curl, curl 7.54.0 (x86_64-apple-darwin17.0) libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
wget: /usr/local/bin/wget, GNU Wget 1.19.1 built on darwin16.6.0.
git: /usr/local/bin/git, git version 2.14.2
grep: grep: aliased to grep  --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} (grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}), grep (BSD grep) 2.5.1-FreeBSD
awk: /usr/bin/awk, awk version 20070501
sed: illegal option -- -
usage: sed script [-Ealn] [-i extension] [file ...]
       sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
sed: /usr/bin/sed,
cut: illegal option -- -
usage: cut -b list [-n] [file ...]
       cut -c list [file ...]
       cut -f list [-s] [-d delim] [file ...]
cut: /usr/bin/cut,
basename: illegal option -- -
usage: basename string [suffix]
       basename [-a] [-s suffix] string [...]
basename: /usr/bin/basename,
rm: illegal option -- -
usage: rm [-f | -i] [-dPRrvW] file ...
       unlink file
rm: /bin/rm,
mkdir: illegal option -- -
usage: mkdir [-pv] [-m mode] directory ...
mkdir: /bin/mkdir,
xargs: illegal option -- -
usage: xargs [-0opt] [-E eofstr] [-I replstr [-R replacements]] [-J replstr]
             [-L number] [-n number [-x]] [-P maxprocs] [-s size]
             [utility [argument ...]]
xargs: /usr/bin/xargs,
nvm current: v6.11.3
which node: $NVM_DIR/versions/node/v6.11.3/bin/node
which iojs: iojs not found
which npm: $NVM_DIR/versions/node/v6.11.3/bin/npm
npm config get prefix: $NVM_DIR/versions/node/v6.11.3
npm root -g: $NVM_DIR/versions/node/v6.11.3/lib/node_modules

       v0.12.15
         v4.5.0
         v6.9.1
->      v6.11.3
         v7.7.1
         v8.5.0
default -> 6.11.3 (-> v6.11.3)
defualt -> v6 (-> v6.11.3)
node -> stable (-> v8.5.0) (default)
stable -> 8.5 (-> v8.5.0) (default)
iojs -> N/A (default)
lts/* -> lts/boron (-> N/A)
lts/argon -> v4.8.4 (-> N/A)
lts/boron -> v6.11.4 (-> N/A)

PeterDaveHello commented 7 years ago

@nepaul does it not working with other versions? Does it now working if you switched to use bash shell?

nepaul commented 7 years ago

@PeterDaveHello It once worked. Maybe since MacOS High Sierra?

ljharb commented 7 years ago

@nepaul what's the output from set -x; nvm uninstall v8.5?

PeterDaveHello commented 7 years ago

@nepaul I don't think so as I tested it with High Sierra and I got no problem.

nepaul commented 7 years ago

@ljharb set -x; nvm uninstall v8.5 output: nvm_check_file_permisions .....like below:

+nvm_check_file_permissions:9> nvm_check_file_permissions /Users/username/.nvm/versions/node/v8.5.0/lib/node_modules/json-server/node_modules/_http-signature@1.2.0@http-signature/node_modules/sshpk/node_modules/bcrypt-pbkdf
+nvm_check_file_permissions:1> local ZSH_HAS_NONOMATCH_UNSET
+nvm_check_file_permissions:2> ZSH_HAS_NONOMATCH_UNSET=1
+nvm_check_file_permissions:3> nvm_has setopt
+nvm_has:1> type setopt
+nvm_check_file_permissions:4> ZSH_HAS_NONOMATCH_UNSET=
+nvm_check_file_permissions:4> set +e
+nvm_check_file_permissions:4> nvm_grep nonomatch
+nvm_check_file_permissions:4> setopt
+nvm_grep:1> GREP_OPTIONS='' grep nonomatch
+nvm_check_file_permissions:4> nvm_echo 0
+nvm_echo:1> printf '%s\n' 0
+nvm_check_file_permissions:4> ZSH_HAS_NONOMATCH_UNSET=0
+nvm_check_file_permissions:5> setopt nonomatch
....
...
...
scoyzhao commented 7 years ago

i met the same problem... did you get useful way to solve it? @nepaul

herozhang commented 7 years ago

same problem

nepaul commented 7 years ago

@scoyzhao not yet.

cmal commented 6 years ago

same problem

PeterDaveHello commented 6 years ago

@nepaul can you post the whole output here: https://pastebin.com/

qzmer1104 commented 5 years ago

same problem。

NineDayForever commented 5 years ago

same problem nvm: 0.34.0 ,mac OS 10.13, zsh 5.3 rm -rf ~/.nvm/versions/node/vx.xx.x/lib/node_modules then nvm uninstall will success

ljharb commented 5 years ago

@NineDayForever that suggests you used sudo npm install -g at some point. sudo is never needed with nvm, and doing so will definitely prevent your ability to uninstall.