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

Install.cmd Deletes PATH environment data #546

Open
13 tasks
CheshireC4t opened this issue Jun 5, 2020 · 2 comments
Open
13 tasks

Install.cmd Deletes PATH environment data #546

CheshireC4t opened this issue Jun 5, 2020 · 2 comments

Comments

@CheshireC4t
Copy link

Make sure you have reviewed the common issues and existing issues before submitting a new issue.

If this is a question about how to use NVM4W, please use stackoverflow instead.

If this is an issue regarding antivirus, make sure you search the existing issues first.

My Environment

  • Windows 7 or below (not truly supported due to EOL - see wiki for details)

  • Windows 8

  • Windows 8.1

  • [X ] Windows 10

  • Windows 10 IoT Core

  • Windows Server 2012

  • Windows Server 2012 R2

  • Windows Server 2016

  • My Windows installation is non-English.

I'm using NVM4W version:

1.1.7

I have already...

  • [X ] read the README to be aware of npm gotchas & antivirus issues.
  • [X ] reviewed the wiki to make sure my issue hasn't already been resolved.
  • [X ] verified I'm using an account with administrative privileges.
  • [X ] searched the issues (open and closed) to make sure this isn't a duplicate.
  • [X ] made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • settings.txt
  • proxy support (Have you tried version 1.1.0+?)
  • 32 or 64 bit support (Have you tried version 1.1.3+?)
  • Character escaping (Have you tried version 1.1.6+?)
  • A standard shell environment (terminal/powershell)
  • [X ] A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

When running "install.cmd", you expect 2 more paths to be added to the PATH environment variable.

Actual Behavior

It will delete a lot of data in your PATH variable caused by this line:
setx /M PATH "%PATH%;%NVM_HOME%;%NVM_SYMLINK%"

Steps to reproduce the problem:

  1. Have PATH environment variable contain data above 1024 characters long.
  2. Run "install.cmd".
  3. See warning message, "WARNING: The data being saved is truncated to 1024 characters. SUCCESS: Specified value was saved."
  4. Check your environment PATH, only the first 1024 characters were kept, everything else was deleted.
  5. Cringe as your computer explodes and do a system restore. :-p

Cause:

As outlined in below link, SETX can't handle more than 1024 characters.
https://superuser.com/questions/812754/how-to-recover-from-path-being-truncated-to-1024-characters-by-setx

@beatgrabe
Copy link

I have had the same or similar issue. The variables are not resolved, see screenshot from Rapid Environment Editor:

image

Also my nodejs/npm entries are gone...My PATH contains more than 1400 characters...

@totszwai
Copy link

Install.cmd also doesn't work in Windows container, the last line where it tries to open the settings.txt in notepad just hangs the whole container as there is no GUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants