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

[Bug]: NVM doesnt install #1027

Open
tm69 opened this issue Sep 24, 2024 · 6 comments
Open

[Bug]: NVM doesnt install #1027

tm69 opened this issue Sep 24, 2024 · 6 comments
Labels

Comments

@tm69
Copy link

tm69 commented Sep 24, 2024

Platform

Windows

Operating system version

Windows 11 Pro (23H2 | 22631.4169)

System architecture

Windows

Herd Version

1.11.0

PHP Version

No response

Bug description

In the node tab doesn't recognize NVM, I reinstalled, erase all directories and remove my system environment variables.

When I reinstall Herd and click Install NVM flashes and doesn't install it

image

and in the herd NVM folder only has these files and doesn't register system environment variables.

image

Steps to reproduce

No response

Relevant log output

No response

@issuelabeler issuelabeler bot added the windows label Sep 24, 2024
@isimmons
Copy link

Possibly related issue

I did terrible troubleshooting by trying random things and not documenting properly, and caused more issues for myself, but at one point had this exact problem.

So, on a hunch, check if the target of the nodejs symlink in "Program Files" exists and if so, is it pointing to an actual existing node installation in .config/herd/bin/nvm ? After reinstalling herd as you did, if you didn't delete the symlink, it should be pointing at a non-existent node directory.

@mpociot mpociot added the needs more information Further information is requested label Sep 25, 2024
@tm69
Copy link
Author

tm69 commented Sep 25, 2024

The symnlink was already deleted and after reinstall Herd and click install nvm doesn´t set the enviroment variables, only create the 3 files on te image above

@tm69
Copy link
Author

tm69 commented Sep 25, 2024

[2024-09-25 10:20:34.033] [info] Running NVM install command: Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File "C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1" -NVM_PATH "C:\Users\x.config\herd\bin\nvm"' -Verb RunAs -Wait
[2024-09-25 10:20:34.062] [error] Error occurred in handler for 'herd.install-nvm':
[2024-09-25 10:20:34.081] [error] [NodeVersionManager] isInstalled: ExceptionError: Command failed: powershell -Command '"C:\Users\x\.config\herd\bin\nvm\nvm.exe" --version'
[2024-09-25 10:20:34.268] [info] [NodeVersionManager] installedNodeVersions:
[2024-09-25 10:20:34.268] [info] [NodeVersionManager] parseNodeVersionList: [ '' ]
[2024-09-25 10:20:34.268] [info] [NodeVersionManager] installedNodeVersions:
ERROR open C:\Users\x.config\herd\bin\nvm\settings.txt: The system cannot find the file specified.

[2024-09-25 10:20:34.268] [info] [NodeVersionManager] parseNodeVersionList: [
'',
'ERROR open C:\Users\x\.config\herd\bin\nvm\settings.txt: The system cannot find the file specified.',
''
]

@mpociot
Copy link
Member

mpociot commented Sep 26, 2024

@tm69 can you try and manually run the install.ps1 script in powershell?

@tm69
Copy link
Author

tm69 commented Sep 26, 2024

@tm69 can you try and manually run the install.ps1 script in powershell?

@mpociot with administrative permissions or normal?

@tm69
Copy link
Author

tm69 commented Sep 27, 2024

In unprivileged mode

╰─ .\install.ps1 ─╯
MethodInvocationException: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:9
Line |
9 | [Environment]::SetEnvironmentVariable("NVM_HOME", $NVM_HOME, [Environ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "SetEnvironmentVariable" with "3" argument(s): "Requested registry access is not allowed."
MethodInvocationException: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:10
Line |
10 | [Environment]::SetEnvironmentVariable("NVM_SYMLINK", $NVM_SYMLINK, [E …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "SetEnvironmentVariable" with "3" argument(s): "Requested registry access is not allowed."
Out-File: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:13
Line |
13 | "PATH=$env:PATH" | Out-File "$NVM_HOME\PATH.txt"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Access to the path 'C:\PATH.txt' is denied.
MethodInvocationException: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:18
Line |
18 | [Environment]::SetEnvironmentVariable("PATH", $NewPath, [EnvironmentV …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "SetEnvironmentVariable" with "3" argument(s): "Requested registry access is not allowed."
OperationStopped: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:29
Line |
29 | $NVM_HOME = $a.GetFolder($NVM_HOME).ShortPath
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Value does not fall within the expected range.
Out-File: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:40
Line |
40 | $content | Out-File -FilePath "$NVM_HOME\settings.txt" -Encoding ASCI …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Access to the path 'C:\settings.txt' is denied.
&: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:46
Line |
46 | & $NVM_HOME\nvm.exe root "$NVM_HOME"
| ~~~~~~~~~~~~~~~~~
| The term '\nvm.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.
&: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:49
Line |
49 | & $NVM_HOME\nvm.exe install latest
| ~~~~~~~~~~~~~~~~~
| The term '\nvm.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.
&: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:52
Line |
52 | & $NVM_HOME\nvm.exe use latest
| ~~~~~~~~~~~~~~~~~
| The term '\nvm.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.

Suggestion [3,General]: The command "\nvm.exe" was not found, but does exist in the current location.
PowerShell does not load commands from the current location by default (see ''Get-Help about_Command_Precedence'').

If you trust this command, run the following command instead:

With run as administrator

╰─ .\install.ps1 ─╯
OperationStopped: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:29
Line |
29 | $NVM_HOME = $a.GetFolder($NVM_HOME).ShortPath
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Value does not fall within the expected range.
&: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:46
Line |
46 | & $NVM_HOME\nvm.exe root "$NVM_HOME"
| ~~~~~~~~~~~~~~~~~
| The term '\nvm.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.
&: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:49
Line |
49 | & $NVM_HOME\nvm.exe install latest
| ~~~~~~~~~~~~~~~~~
| The term '\nvm.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.
&: C:\Program Files\Herd\resources\app.asar.unpacked\resources\bin\nvm\install.ps1:52
Line |
52 | & $NVM_HOME\nvm.exe use latest
| ~~~~~~~~~~~~~~~~~
| The term '\nvm.exe' is not recognized as a name of a cmdlet, function, script file, or executable program. Check
| the spelling of the name, or if a path was included, verify that the path is correct and try again.

Suggestion [3,General]: The command "\nvm.exe" was not found, but does exist in the current location.
PowerShell does not load commands from the current location by default (see ''Get-Help about_Command_Precedence'').

If you trust this command, run the following command instead:

And when I run as administrator make 2 files in C
image

settings.txt

generated in enviroment variables NVM_SYMLINK and add to path C:\Program Files\nodejs without the symlink

@github-actions github-actions bot added the Stale label Oct 3, 2024
@sschlein sschlein removed needs more information Further information is requested Stale labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants