nvm: "node: command not found" every time terminal opens

Every time I open a new terminal window or start a new process I have to type nvm use --delete-prefix v10.13.0 before node is added to the path.

The README.md says I can use nvm alias default node to set a default node version to be used in any new shell, but this command doesn’t do anything. Node is never on the path when a new process starts.

  • Operating system and version: Mac OS X High Sierra
  • nvm debug output:
nvm --version: v0.33.11
$TERM_PROGRAM: iTerm.app
$SHELL: /bin/bash
$SHLVL: 1
$HOME: /Users/jason
$NVM_DIR: '$HOME/.nvm'
$PATH: $NVM_DIR/versions/node/v10.13.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)'
uname -a: 'Darwin 17.7.0 Darwin Kernel Version 17.7.0: Wed Oct 10 23:06:14 PDT 2018; root:xnu-4570.71.13~1/RELEASE_X86_64 x86_64'
OS version: Mac 10.13.6 17G3025
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: not found
git: /usr/local/bin/git, git version 2.10.1
grep: /usr/bin/grep, 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: v10.13.0
which node: $NVM_DIR/versions/node/v10.13.0/bin/node
which iojs:
which npm: $NVM_DIR/versions/node/v10.13.0/bin/npm
npm config get prefix: /Users/Jason/.nvm/versions/node/v10.13.0
npm root -g: /Users/Jason/.nvm/versions/node/v10.13.0/lib/node_modules
- `nvm ls` output:
->     v10.13.0
default -> v10.13.0
node -> stable (-> v10.13.0) (default)
stable -> 10.13 (-> v10.13.0) (default)
iojs -> N/A (default)
lts/* -> lts/dubnium (-> v10.13.0)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.4 (-> N/A)
lts/carbon -> v8.12.0 (-> N/A)
lts/dubnium → v10.13.0

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

@maxwellgerber nvm alias default node also works, in lieu of an .nvmrc file.

I had this problem with a new laptop the other day. I was trying to call node before nvm had been initialized - and I don’t have node on my default path. I moved this further up in my .bashrc

 echo loading nvm conf
 export NVM_DIR="$HOME/.nvm"
 [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

and then I added a .nvmrc file to my home directory.

I had this problem with a new laptop the other day. I was trying to call node before nvm had been initialized - and I don’t have node on my default path. I moved this further up in my .bashrc

 echo loading nvm conf
 export NVM_DIR="$HOME/.nvm"
 [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

and then I added a .nvmrc file to my home directory.

however it make my iTerm2 so slow. is it my only problem?

I must have set up my work machine a little more carefully than the one under the Christmas tree…

No, nvm alias default node doesn’t do anything. I’m not using an .nvmrc file either. [EDIT: Never mind, I just got it to work: npm config delete prefix npm config set prefix $NVM_DIR/node/v10.14.1 nvm alias default node Deleting the prefix without setting it afterward will make it keep coming back every time you open a window.]