Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install script does not add the source line to .zshrc when using zsh #1879

Closed
MuhsinFatih opened this issue Aug 2, 2018 · 3 comments
Closed
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. shell: zsh

Comments

@MuhsinFatih
Copy link

  • Operating system and version:
    Ubuntu 16.04.2 LTS
  • nvm debug output:
nvm --version: v0.33.11
$SHELL: /usr/bin/zsh
$SHLVL: 1
$HOME: /home/mufa
$NVM_DIR: '$HOME/.nvm'
$PATH: $NVM_DIR/versions/node/v10.8.0/bin:$HOME/bin:$HOME/.local/bin:/opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: ''
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'zsh 5.1.1 (x86_64-ubuntu-linux-gnu)'
uname -a: 'Linux 4.4.0-1049-aws #58-Ubuntu SMP Fri Jan 12 23:17:09 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux'
OS version: Ubuntu 16.04.2 LTS
curl: /usr/bin/curl, curl 7.47.0 (x86_64-pc-linux-gnu) libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
wget: /usr/bin/wget, GNU Wget 1.17.1 built on linux-gnu.
git: /usr/bin/git, git version 2.7.4
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 (GNU grep) 2.25
awk: /usr/bin/awk, GNU Awk 4.1.3, API: 1.1 (GNU MPFR 3.1.4, GNU MP 6.1.0)
sed: /bin/sed, sed (GNU sed) 4.2.2
cut: /usr/bin/cut, cut (GNU coreutils) 8.25
basename: /usr/bin/basename, basename (GNU coreutils) 8.25
rm: /bin/rm, rm (GNU coreutils) 8.25
mkdir: /bin/mkdir, mkdir (GNU coreutils) 8.25
xargs: /usr/bin/xargs, xargs (GNU findutils) 4.7.0-git
nvm current: v10.8.0
which node: $NVM_DIR/versions/node/v10.8.0/bin/node
which iojs: iojs not found
which npm: $NVM_DIR/versions/node/v10.8.0/bin/npm
npm config get prefix: $NVM_DIR/versions/node/v10.8.0
npm root -g: $NVM_DIR/versions/node/v10.8.0/lib/node_modules
  • nvm ls output:
->      v10.8.0
default -> stable (-> v10.8.0)
node -> stable (-> v10.8.0) (default)
stable -> 10.8 (-> v10.8.0) (default)
iojs -> N/A (default)
lts/* -> lts/carbon (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.14.3 (-> N/A)
lts/carbon -> v8.11.3 (-> N/A)
  • How did you install nvm?
    install script in readme
  • What steps did you perform?
    Installed via script, that's it.
  • What happened?
    When I open a new session I got zsh: command not found: nvm. I figured the source line was not added to .zshrc file even though the readme file suggests that it should. I added the source line and it worked. (I added the source line to .profile file, which I use for common directives for both shells. Both .zshrc and .bashrc source this file)
  • What did you expect to happen?
    The lines:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

Should have been added to .zshrc after running the script, instead they were added to .bashrc although my default shell is zsh

  • Is there anything in any of your profile files (.bashrc, .bash_profile, .zshrc, etc) that modifies the PATH?
    Well, many, but here's my $PATH right now: /home/mufa/.nvm/versions/node/v10.8.0/bin:/home/mufa/bin:/home/mufa/.local/bin:/opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
@MuhsinFatih
Copy link
Author

MuhsinFatih commented Aug 2, 2018

I have just tried installing on macos 10.14 Beta (18A336e), and got the same result. Although I have zsh as default shell, the script added the lines in .bash_profile. Here is the output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12819  100 12819    0     0  84713      0 --:--:-- --:--:-- --:--:-- 84894
=> Downloading nvm from git to '/Users/muhsinfatih/.nvm'
=> Cloning into '/Users/muhsinfatih/.nvm'...
remote: Counting objects: 267, done.
remote: Compressing objects: 100% (242/242), done.
remote: Total 267 (delta 31), reused 86 (delta 15), pack-reused 0
Receiving objects: 100% (267/267), 119.47 KiB | 4.42 MiB/s, done.
Resolving deltas: 100% (31/31), done.
=> Compressing and cleaning up git repository

=> Appending nvm source string to /Users/muhsinfatih/.bash_profile
=> Appending bash_completion source string to /Users/muhsinfatih/.bash_profile
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

@ljharb ljharb added shell: zsh installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. labels Aug 2, 2018
@ljharb
Copy link
Member

ljharb commented Aug 2, 2018

This seems like a duplicate of #1717, or #592? Happy to reopen if not.

@ljharb ljharb closed this as completed Aug 2, 2018
@MuhsinFatih
Copy link
Author

Sorry! I checked but I didn't see those before creating the issue, my bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing nvm: profile detection Issues with nvm's own install script, related to figuring out the right profile file. shell: zsh
Projects
None yet
Development

No branches or pull requests

2 participants