# Error while piping nvm to zsh shell during installation

**URL:** <https://forum.communityhealthtoolkit.org/t/error-while-piping-nvm-to-zsh-shell-during-installation/3023>\
**Category:** Technical Support\
**Tags:** configuration, documentation\
**Created:** [September 12, 2023, 8:25am UTC](https://forum.communityhealthtoolkit.org/t/error-while-piping-nvm-to-zsh-shell-during-installation/3023 "2023-09-12T08:25:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Kiarie](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ben_kiarie/32/2529_2.png) [@Ben\_Kiarie](https://forum.communityhealthtoolkit.org/u/Ben_Kiarie)\
**Post date:** [September 12, 2023, 8:25am UTC](https://forum.communityhealthtoolkit.org/t/error-while-piping-nvm-to-zsh-shell-during-installation/3023/1 "2023-09-12T08:25:35Z")

</div>

Hi everyone,

I am using Ubuntu 22.04 and on zsh shell.

While following the instructions to [Install NodeJS, npm, and Docker](https://docs.communityhealthtoolkit.org/contribute/code/core/dev-environment/#install-nodejs-npm-and-docker) as part of the **CHT Core dev environment setup** I ran into an issue.

I ran the first command and that worked as expected.

```auto
export nvm_version=`curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r .name`

```

However, when I ran the second command

```auto
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh | $SHELL
. ~/.$(basename $SHELL)rc

```

I got the following error in my terminal

```auto
Error: the install instructions explicitly say to pipe the install script to `bash`; please follow them

```

If I understand correctly, the `$(basename $SHELL)` part of the second command is designed to work both for bash and zsh. However, it did not work for me despite several tries.

---

<div class="post-metadata">

**Author:** ![Ben\_Kiarie](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/ben_kiarie/32/2529_2.png) [@Ben\_Kiarie](https://forum.communityhealthtoolkit.org/u/Ben_Kiarie)\
**Post date:** [September 12, 2023, 8:30am UTC](https://forum.communityhealthtoolkit.org/t/error-while-piping-nvm-to-zsh-shell-during-installation/3023/2 "2023-09-12T08:30:35Z")

</div>

My workaround to the issue was to do as the error message suggested and pipe it to `bash` directly with

```auto
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh | bash

```

Then I copied the following lines to my `~/.zshrc`.

```auto
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.zshrc
echo '[-s "$NVM_DIR/nvm.sh"] && \. "$NVM_DIR/nvm.sh"' >> ~/.zshrc
echo '[-s "$NVM_DIR/bash_completion"] && \. "$NVM_DIR/bash_completion"' >> ~/.zshrc

```

with that I have `NodeJS` 16.20.2 and `nvm` version 8.19.4 working in my `zsh`

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [September 12, 2023, 8:32am UTC](https://forum.communityhealthtoolkit.org/t/error-while-piping-nvm-to-zsh-shell-during-installation/3023/3 "2023-09-12T08:32:49Z")

</div>

> [@Ben\_Kiarie](#):
>
> `Error: the install instructions explicitly say to pipe the install script to `bash`; please follow them`

This made me laugh. Passive aggressive error messages 😃
