nvm: `sort` command not found

Hi, I’m getting this error:

~/scm/bigSmall/ops/stage/mupx ~/bigSmall/ops/stage/mupx
=====================================================
---- Mupx Deploy for stage ---------------------
-----------------------------------------------------
load
current
v0.10.46
install
/usr/bin/sort
/home/michael/.nvm/nvm.sh: line 748: sort -t. -u -k 1.2: command not found

From this script:

#!/bin/bash
set -e

BUILDFOR="$1"
SERVER="$2"
IFS=',' MUPX_APPS=($3)
CONFDIR=`pwd`

echo "====================================================="
echo "---- Mupx Deploy for $BUILDFOR ---------------------"
echo "-----------------------------------------------------"

echo "load"
source ~/.nvm/nvm.sh
echo "current"
nvm current
echo "install"
which sort
nvm install 0.10.46
echo "update"
npm update -g mupx
echo "done"

Any suggestions?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Hi, I actually found the source of the problem. I’m using ‘bash strict mode’.

http://redsymbol.net/articles/unofficial-bash-strict-mode/

The change of the field separator from space to \n\t triggers the problem.

I worked around it by setting the IFS

IFS=$' ' # nvm expects the default field separator
  # DO nvm stuff
IFS=$'\n\t' # reset to use bash strict mode

You still need a separate issue since this ticket is what google sent me to when I searched for the same error?

will do