beyondcode / herd-community

78 stars 1 forks source link

[Bug]: nvm installed but not recognized #552

Closed SamuelNitsche closed 5 months ago

SamuelNitsche commented 5 months ago

Platform

macOS

Operating system version

macOS Sonoma 14.4

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.5.0

PHP Version

No response

Bug description

Nvm was not installed on my machine prior to installing Herd. I installed it using the big red button in the "Node" tab inside Herd. I am now able to run nvm commands in my shell. However, Herd still wants me to install nvm using the big red button

Steps to reproduce

Install Herd on a machine without nvm. Install nvm using Herd, restart Herd and open the "Node" Tab

Relevant log output

No response

mpociot commented 5 months ago

@SamuelNitsche This could happen if Herd is unable to detect NVM properly. Are you using a shell other than Bash/ZSH?

SamuelNitsche commented 5 months ago

Nope, I am using zsh with oh-my-zsh

CleanShot 2024-03-28 at 15 24 22

mpociot commented 5 months ago

This is the exact command that we run in order to read the NVM_DIR environment variable:

/bin/zsh -l -c "[[ -f ~/.zshrc ]] && source ~/.zshrc; echo $NVM_DIR"

The result gets trimmed. Could this be empty for you because you have any additional shell output?

SamuelNitsche commented 5 months ago

That explains the issue. I had referenced an oh-my-zsh plugin which wasn't installed. This caused the following output:

CleanShot 2024-03-28 at 15 35 22

dinhquochan commented 5 months ago

Same me, Install NVM does not response...

output.webm

SamuelNitsche commented 5 months ago

Did you check the output of the command Marcel posted earlier?

dinhquochan commented 5 months ago
image
SHSharkar commented 5 months ago

I am also facing the same issues. On my Mac, I have installed Herd, which automatically installs the NVM. but it seems it could not be detected in GUI.

Here are additional details:

macOS: 14.4.1

Chip: Apple M2

Herd Version: 1.5.0


echo $SHELL /bin/zsh

which zsh /opt/homebrew/bin/zsh

which node /Users/sharkar/Library/Application Support/Herd/config/nvm/versions/node/v21.7.1/bin/node

which npm /Users/sharkar/Library/Application Support/Herd/config/nvm/versions/node/v21.7.1/bin/npm

which php /Users/sharkar/Library/Application Support/Herd/bin//php

php --version PHP 8.2.16 (cli) (built: Feb 16 2024 00:30:02) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.16, Copyright (c) Zend Technologies with Zend OPcache v8.2.16, Copyright (c), by Zend Technologies


image

mpociot commented 5 months ago

@SamuelNitsche did it work for you after cleaning the ZSH output?

mpociot commented 5 months ago

I have improved the way we detect NVM, so this will be fixed in the next release

vcardillo commented 5 months ago

I am having a similar issue:

$ echo $SHELL
/bin/bash
$ /bin/zsh -l -c "[[ -f ~/.zshrc ]] && source ~/.zshrc; echo $NVM_DIR"
/Users/me/Library/Application Support/Herd/config/nvm

Am I encountering the same issue?

mpociot commented 5 months ago

This fixed with Herd 1.6.0

fboc commented 4 months ago

This fixed with Herd 1.6.0

I still have this issue with NVM, also after the 1.6.0 update

roshanjonah commented 4 months ago

Me too. I am running on 1.6.0 on Mac but just does nothing when I click and neither does it recognise.

MarkKnowlesR40 commented 3 months ago

Similar here, but on a newer version of Herd.... Herd 1.6.1 // Sonoma 14.5 // Settings | Node | Install NVM (Nothing Happens)

mpociot commented 3 months ago

@MarkKnowlesR40 which shell do you use?

fboc commented 3 months ago

Similar here, but on a newer version of Herd.... Herd 1.6.1 // Sonoma 14.5 // Settings | Node | Install NVM (Nothing Happens)

Nothing happens also on Ventura 13.6.7 with Herd 1.6.1.

MarkKnowlesR40 commented 3 months ago

@MarkKnowlesR40 which shell do you use?

It complicates things, but I switched from bash to ZSH during this. I have two machines that share the same issue. I'm not sure if this is helpful or not, but one thing they have in common is that npm and node are installed in a path that includes a "space" (...Application Support..."). See Below. Tow of my colleagues, who don't have this problem don't have a space in their paths as they installed npm before Herd.

NODE_BINARY_FILE_PATH="/Users/xxxxxxxx/Library/Application Support/Herd/config/nvm/versions/node/v21.7.3/bin/node" NPM_BINARY_FILE_PATH="/Users/xxxxxxxx/Library/Application Support/Herd/config/nvm/versions/node/v21.7.3/bin/npm"