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
[Help]Cannot run 'node' or 'npm' command after nvm installed #221
Comments
You will need to run this inside an "Administrator" or elevated command prompt. To change/create the symlinks nvm requires Administrator permissions. You can probably run regular 'node' and 'npm' commands and some of the non-modifying 'nvm' commands in a non-Administrator prompt, but to make changes to the symlink it requires elevation. |
I encountered the same problem |
@summerinsect Do u fix it? |
I have the same problem. Currently using Windows 10 and have Windows Defender running.
Any suggestions? --- Update ---- I have resolved the issue by doing the following :
My guess is that even though I was running the command prompt with admin right, it didn't have the write access to \program files\nodejs folder. |
@andrewbhy Cool, it works! Thank you so much! |
Steps provided above didn't work for me... I have Far as I can tell, everything is where it needs to be, but NVM isn't persisting which Node version I've set using Extra info: This is a fresh Win7 64 bit instance and I never installed Node on it before trying to get NVM going. |
I don't think you want to have the NVM_HOME and NVM_SYMLINK in both places. What do you have in your settings.txt file? |
@dragon788 I figured out the issue, but it wasn't related to the env path variables. Mind you, NVMs installer setup both variables in both places, so that was not a decision made on my part. The fix for my issue is detailed in #230 |
@coreybutler I have the same problem. After installation, I can run it in admin mode, but not in normal user mode. I seem to remember last time I used this (months ago at this point), that I could use nvm from whereever, but if an installation needed to happen, a prompt would come up. That's a much better experience - you shouldn't have to launch an admin cmd prompt. I think we should reopen this issue. |
If you're downloading the manual installer, this is the experience you can likely expect because nothing is setup for you. This is why I made the installer. It prepares everything for you, including permissions. Keep in mind it is not enough to run this as an administrator on some versions of Windows. Later versions of Windows requires elevated admin privileges, though in most scenarios it should prompt you when you install a new version or make a switch. If you install NVM4W anywhere within If you're having problems with persisting a version of Node, make sure your account has write permissions on the NVM for Windows user data directory. This is required to write the If you're on Windows 7, please read about Windows 7 support. |
@coreybutler I'm not sure what you mean by "manual installer" vs "the installer". I used https://github.com/coreybutler/nvm-windows/releases/download/1.1.1/nvm-setup.zip . My account has admin privileges, but its annoying to have to manually start a cmd prompt with admin privileges in order to access it. Are you saying if I install nvm somewhere other than program files it'll work without elevated privileges? |
@fresheneesz - sorry for being as clear as mud :) By "manual" installer, I meant the "nvm-noinstall.zip". You're using "the installer", i.e. the GUI that walks you through the setup process. Depending on your version of Windows, installing elsewhere only requires admin privileges, not elevated admin privileges. It still needs admin privileges whenever it switches to a new version though (symlinking). @fresheneesz - I just ran a fresh install in Windows 10 and it prompts when switching versions, so I'm not sure why you're having to open a new prompt with admin privileges. Do you have something like cmder/cygwin/git shell installed? Sometimes these shells cause problems like this. |
I seem to have gotten it to work, but I think my computer might be always opening up a cmd prompt with admin mode now? I'm not sure, it suddenly switched to always being green on black, which I thought was admin mode. IDK but it works now so yay! |
Green on Black is the "cmd" prompt. White on Blue is the "PowerShell" prompt. You can usually tell the Administrator permissions in the title bar, it will say "Administrator" up there and sometimes will start in |
Your going to think I'm crazy but I couldn't get npm to work because the files weren't being created for npm deep in the directory tree within c:\Program Files\nodejs\node_mudules\npm No matter how I ran the cmd.exe wether as administrator or not. For giggles I ran the powershell as admin and it had no problem creating the files on Windows Server 2012 R2. What powershell does differently than cmd.exe I have no idea. One annoying thing though, it's slow. |
..Er, well, all kinds of craziness. Had issues with Node v8.4.0 even though I could set/use 6.11.3 with no problem. I ended up uninstalling/removing v8.4.0 and this time when I reinstalled v8.4.0 I left off the "v" and it worked. |
@helzgate cmd.exe is limited to the 256 character path depth I believe while the PowerShell "shell" doesn't seem to suffer from that limitation. Weird that the |
I had the same problem (I could only run |
When I put together the Chocolatey package I believe I had it install to C:\ProgramData because that is accessible by all users but only writable by administrators, but that means as long as you run your |
using nvm windows how to install cordova ? |
npm install -g cordova |
Facing this problem after installing nvm Error: Cannot find module 'C:\Windows\System32\node_modules\cordova\bin\cordova' E:\Cordova projects\CordovaApp>nvm ls
|
@SanjanaTailor - did you have a prior version of Node installed before using nvm4w? See https://github.com/coreybutler/nvm-windows#installation--upgrades |
Excellent @ChuckkNorris |
I tried @ChuckkNorris trick without success. What appears to have worked for me was after
I also see a nodejs in C:\Program Files...wonder if that is attached to nvm |
This is a nightmare. I mean to make this work. I tried all the above: install nvm into something else then Program Files, used PowelShell (Admin) to launch the install, switched on/off nvm, basically none of them worked. |
Hi @csempesz. Could you try uninstall NVM and then install this pre-release and see if it solves your problem? |
I fixed mine like this...
|
Just use powershell rather than cmd and try again. |
@csempesz dont install it via the installer - use chocolatey. This in conjunction with turning nvm on and off, solved it for me |
Installed in a different folder then turned nvm on and off, npm -v works but node -v gives an error "The system cannot find the path specified" |
Fixed all bugs for me. |
I finally fixed this in Windows 7 by:
|
Just run into this issue with nvm v1.1.7 on Windows 10. The solution in my case was to completely delete 'C:\Program Files\nodejs' directory (it existed after NodeJS uninstall). After that |
Thanks! I’ll try to do this and see if it works. |
@ChuckkNorris That worked! Thx! |
@ilog2000 PERFECT! Thank you |
tldr; If none of the methods before work, the specific version of node you're trying to use may have installed incorrectly. Try uninstalling it and reinstalling using All of the previous methods did not work for me. What went wrong for me is one of the versions of Node I installed using |
Using powershell as admin every time was not an option for me... With NVM v1.1.11, the above worked for me but only needed to do the first 2 steps; uninstall nvm, install again on non-default folders directly under C: drive. I didnt need to update the NVM_HOME and NVM_SYMLINK variables. |
I'm trying to install nvm on my windows8.1(64bits). I do as the below orders:
Download zip file.
Unzip and install it.
Configure the env path.
Try to run 'nvm v' and it works well.
Try to install nodejs
nvm install 4.2.4 64
, after a while it tells me installation completed and suggests to runnvm use 4.2.4
to use it.I run
node -v
to see if it really works. Unfortunately, I met some error msg.It means 'This application cannot be run on your computer.'
It confused me. Did anyone meet the same error before? And How to solve it ??
The text was updated successfully, but these errors were encountered: