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

Nvm use failed with "Windows cannot access the specified device, path, or file..." #415

Closed
8 of 29 tasks
Miggleness opened this issue Jan 14, 2019 · 8 comments
Closed
8 of 29 tasks

Comments

@Miggleness
Copy link

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

  • 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
  • 1.1.6
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • Older
  • OTHER (Please Specify)

I have already...

  • read the README to be aware of npm gotchas & antivirus issues.
  • reviewed the wiki to make sure my issue hasn't already been resolved.
  • verified I'm using an account with administrative privileges.
  • searched the issues (open and closed) to make sure this isn't a duplicate.
  • 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)
  • A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

Should activate Node v8.15.0

Actual Behavior

After running nvm use 8.15.0 and approving session elevation I got a pop up error Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.

Back in the terminal, it shows message Now using node v8.15.0 (64-bit) but when I run nvm list I don't see an asterisk on 8.15.0. Also, running node and npm returns an error that they don't exist.

Steps to reproduce the problem:

  1. Install using NVM MSI 1.1.7
  2. Open command prompt and type in nvm install 8.15.0
  3. Run nvm use 8.15.0

My root path doesn't contain any white space. This is a problem I'd likely need to debug (an excuse to try out Go)

@Miggleness Miggleness changed the title Nvm use Nvm use failed with "Windows cannot access the specified device, path, or file..." Jan 14, 2019
@coreybutler
Copy link
Owner

Are you also seeing this?

image

@Miggleness
Copy link
Author

No, what I see is exactly as how I described it. No elevation or VB error.

@Equinix-Leo
Copy link

Equinix-Leo commented Jan 24, 2019

I have something similar here, not sure if it's the exact same issue though.
nvm use 8.15.0
Execution of the Windows Script Host Failed. (Access is denied.)
I am the admin.
Thanks.

@ghost
Copy link

ghost commented Jan 30, 2019

I'm not able to reproduce on my machine.

Is it possible due to a custom installation path on the C drive as the root instead of installing NVM in the default AppData directory? My NVM path is C:\Users\brian\AppData\Roaming\nvm.

@PyrateAkananto
Copy link

PyrateAkananto commented Mar 22, 2019

I'm on Windows 10 64 Bit German.
I have to use "surun" for the installation because I don't have admin rights and no admin account in this corporate network.
Installed nvm 1.1.7 into "C:\Programme Meine\nvm".
During installation did set node path "C:\Programme Meine\node".
Called "nvm install 0.8.22".
Calling "nvm use 0.8.22" gives me the following error:

exit status 1: Der Befehl "C:\Programme" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

Rougly translated from German:

exit status 1: The command "C:\Programme" is written wrong or could not be found."

It probably is related to the whitespace in one of the path names. After a full uninstallation I did the installation again, but with "C:\Programme-Meine" (no whitespace!) and it seems to work now.

I'm sorry if this should not be related to this issue.

@sw-clough
Copy link

Like PyrateAkananto, I installed both node and nvm in C:\Program Files\, and the space is not handled when doing nvm use, and you get the error 'C:\Program' is not recognized...

To fix, I edited the settings.txt file;

root: C:\Progra~1\nvm
path: C:\Progra~1\nodejs

@mmben
Copy link

mmben commented May 18, 2021

I'm experiencing the reported problem as well. However, only when I run on an elevated command prompt.
When running without elevation, the UAC prompts and switching node versions works fine.
I'm using nvm 1.1.7 on Windows 10 as well.
I'm using default installation paths:
root: C:\ProgramData\nvm
path: C:\Program Files\nodejs

I don't think this is a whitespace problem, as I have tried to change the path to a non-whitespace-path location, which didn't change anything.

I do have a McAfee Installation, which is why I maybe ran into #551. Could this be Anti-Virus related as well?

Edit:
On our build server everything works as expected. I also did not run into the other problem. There we have a less restrictive McAfee policy. The fact that McAfee did not notify me at all rather lets me think it could be a windows policy set by the company IT. Hope this helps anyone to pin it.

@coreybutler
Copy link
Owner

Closing due to age. This has been addressed in both v1.1.8 and v1.1.9. If the issue persists, please review https://github.com/coreybutler/nvm-windows/wiki/Common-Issues#permissions-exit-1-exit-5-access-denied-exit-145. Open a new issue if this does not help.

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

6 participants