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

[Issue]: NVM Install via batch file #1091

Open
LorenDorez opened this issue Jan 17, 2024 · 11 comments
Open

[Issue]: NVM Install via batch file #1091

LorenDorez opened this issue Jan 17, 2024 · 11 comments

Comments

@LorenDorez
Copy link

What happened?

Using a batch file to install and setup nvm and a few other bells and whistles but seems you cant use nvm right after install in the same batch files.

What did you expect to happen?

Below is the basics of the batch file and a snapshot of the issue

ECHO Install NVM For Windows...
winget install nvm-windows

ECHO Installing v20.10.0 ...
%AppData%\nvm\nvm.exe install 20.10.0

%AppData%\nvm\nvm.exe use 20.10.0
%AppData%\nvm\nvm.exe current
%AppData%\nvm\nvm.exe debug

image

Version

1.1.11 or newer (Default)

Which version of Windows?

Windows 11+

Which locale?

English (Default)

Which shell are you running NVM4W in?

Command Prompt

User Permissions?

Administrative Privileges, Elevated

Is Developer Mode enabled?

No (Default)

Relevant log/console output

Install NVM For Windows...
Found NVM for Windows [CoreyButler.NVMforWindows] Version 1.1.11
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://github.com/coreybutler/nvm-windows/releases/download/1.1.11/nvm-setup.exe
  ██████████████████████████████  5.46 MB / 5.46 MB
Successfully verified installer hash
Starting package install...
Successfully installed


Set temp variable NVM_HOME...

Installing v20.10.0 ...
Downloading node.js version 20.10.0 (64-bit)...
Extracting node and npm...
Complete
npm v10.2.3 installed successfully.


Installation complete. If you want to use this version, type

nvm use 20.10.0


Setting to use v20.10.0...
Now using node v20.10.0 (64-bit)
No current version. Run 'nvm use x.x.x' to set a version.
Running NVM for Windows with administrator privileges.

C:\WINDOWS\System32\cmd.exe
NVM4W Version:      1.1.11
NVM4W Path:         UNKNOWN: not found
NVM4W Settings:     C:\Users\loren-dorez\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\loren-dorez\AppData\Roaming\nvm
NVM_SYMLINK:        .
Node Installations: C:\Users\loren-dorez\AppData\Roaming\nvm

Active Node.js Version: none
(run "nvm use <version>" to activate a version)

PROBLEMS DETECTED
-----------------
"C:\WINDOWS\System32\cmd.exe" is not an officially supported shell. Some features may not work as expected.


The NVM4W symlink (.) was not found in the PATH environment variable.


Find help at https://github.com/coreybutler/nvm-windows/wiki/Common-Issues

Debug Output

Running NVM for Windows with administrator privileges.

C:\WINDOWS\System32\cmd.exe
NVM4W Version:      1.1.11
NVM4W Path:         UNKNOWN: not found
NVM4W Settings:     C:\Users\loren-dorez\AppData\Roaming\nvm\settings.txt
NVM_HOME:           C:\Users\loren-dorez\AppData\Roaming\nvm
NVM_SYMLINK:        .
Node Installations: C:\Users\loren-dorez\AppData\Roaming\nvm

Active Node.js Version: none
(run "nvm use <version>" to activate a version)

PROBLEMS DETECTED
-----------------
"C:\WINDOWS\System32\cmd.exe" is not an officially supported shell. Some features may not work as expected.


The NVM4W symlink (.) was not found in the PATH environment variable.


Find help at https://github.com/coreybutler/nvm-windows/wiki/Common-Issues

Anything else?

any help is appreciated

@coreybutler
Copy link
Owner

We don't maintain the winget installer. It looks like it's not updating the PATH though. See https://github.com/coreybutler/nvm-windows/wiki.

@LorenDorez
Copy link
Author

If I open a new command prompt everything works just fine. I just can't use nvm in the same shell I install it with.

I'll see it if I can manually set the path in my shell as see if that helps. I had to do that for %NVM_HOME%

@sitiom
Copy link
Contributor

sitiom commented Feb 9, 2024

We don't maintain the winget installer. It looks like it's not updating the PATH though. See coreybutler/nvm-windows/wiki.

You actually do, though 😅: https://github.com/coreybutler/nvm-windows/blob/master/.github/workflows/winget.yml. About Winget, It's just running the installer you provided, which means there is no magic happening on the Winget side behind the scenes.

About the workflow error: https://github.com/coreybutler/nvm-windows/actions/runs/6962150119/job/18984279583, can you try manually syncing https://github.com/coreybutler/winget-pkgs up-to-date and rerunning the failed workflow? I think the reason for the failure is due to an outdated fork.

@coreybutler
Copy link
Owner

@sitiom as you know, that workflow has never actually worked. Truthfully, it's more hassle than it's worth, especially since our focus is on Runtime. I don't really want users installing from winget with this tool because it just keeps adding issues I don't really have time to deal with. We're planning proper support for winget with Runtime (as well as other install options), so that's where my focus is.

@LorenDorez The innosetup installer sometimes works in the shell you install in and sometimes doesn't. It's an extremely annoying issue with innosetup+windows where Windows isn't signaling completion properly, so things sometimes get updated out of order (seems worst on Windows 10, but happens on 11 and servers too). That's why the docs recommend restarting the shell. So, for your case, you probably will need to manually specify the env vars for the shell you're running in. I'm sorry for that... I wish I had a better answer for you.

@sitiom
Copy link
Contributor

sitiom commented Feb 9, 2024

@sitiom as you know, that workflow has never actually worked.

From the workflow:

Both issues are easily actionable.

Truthfully, it's more hassle than it's worth, especially since our focus is on Runtime. I don't really want users installing from winget with this tool because it just keeps adding issues I don't really have time to deal with.

Like I said, Winget runs the official installer, which means that the issues should not come from the Winget side.

You can try out the thing I suggested above and see if it works. It only takes a minute of your time:

can you try manually syncing coreybutler/winget-pkgs up-to-date and rerunning the failed workflow? I think the reason for the failure is due to an outdated fork.

Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Stale label Mar 11, 2024
@sitiom
Copy link
Contributor

sitiom commented Mar 11, 2024

Bump

@github-actions github-actions bot removed the Stale Stale label Mar 12, 2024
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Stale label Apr 11, 2024
@sitiom
Copy link
Contributor

sitiom commented Apr 11, 2024

Bump

@github-actions github-actions bot removed the Stale Stale label Apr 12, 2024
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Stale label May 12, 2024
@sitiom
Copy link
Contributor

sitiom commented May 12, 2024

Bump

@github-actions github-actions bot removed the Stale Stale label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants