beyondcode / herd-community

72 stars 1 forks source link

[Bug]: Install NVM button is not doing anything #787

Open Mavv3006 opened 3 weeks ago

Mavv3006 commented 3 weeks ago

Platform

macOS

Operating system version

macOS Sonoma 14.5

System architecture

ARM64 (M1, M2, etc)

Herd Version

1.6.1

PHP Version

8.3

Bug description

Currently I do not have nvm installed because I wanted to use the nvm which comes with the Herd installation.

But when opening the Node menu in Herd the install nvm button appears. But after clicking it, it does nothing

Also refer to https://github.com/beyondcode/herd-community/discussions/492

Steps to reproduce

prerequisites:

  1. do not have nvm installed
  2. do not have herd installed

steps:

  1. install herd
  2. open herd and navigate to the Node menu
  3. click the appearing "install nvm" button
  4. => nothing happens

Relevant log output

No response

Mavv3006 commented 3 weeks ago
Bildschirmfoto 2024-06-10 um 09 51 51
Mavv3006 commented 3 weeks ago

FYI: After the installation of Herd 1.7.1 (update from 1.6.1) nvm has been installed on my machine.

note: This is not a resolution of this issue, but rather a notice to find the root cause.

lesaff commented 2 weeks ago

Upgraded to 1.7.1 (Herd Pro) and Install NVM is still not working.

jingidy commented 1 week ago

I have the same problem except I already have an nvm on my machines, I unchecked the "install node using nvm" when installing herd, but now herd says unknown node version for all sites and the button to install does nothing.

davidbarker commented 1 week ago

Fix

Temporarily remove the contents of your ~/.zshrc (or similar) file if you've customised it.

Explanation

I've had this exact issue ever since I first started to use Herd. However, I just noticed this in the Herd documentation (https://herd.laravel.com/docs/1/advanced-usage/node-versions):

Herd parses command output to determine your current Node.js version. If it can't parse the output because there is output that it doesn't understand, or you are using an unsupported shell, it displays Unknown for your node version in the sites list. Herd is an opinionated development environment that relies on bash or zsh and other shells lead to errors.

It made me think — perhaps my ~/.zshrc file is causing the output to be unreadable to Herd. I deleted the contents of the ~/.zshrc file and the Install NVM button worked immediately!

Herd adds a couple of lines to the ~/.zshrc file, so I just pasted the original contents above it.

alexanderzeillinger commented 1 week ago

Similar issue with v1.8.0 on Windows - when clicking the button it flickers shortly showing the installed versions but then the button returns.

lesaff commented 4 days ago

I've updated my Herd install to v1.8.0 and the Node install works now. Thanks!