The term 'node' is not recognized... In Powershell - windows

I have been trying to resolve this issue for the whole day.
When I run node -v or npm install in cmd prompt, it works absolutely fine. But when I run the same commands in Powershell, it gives the following error:s
PS C:\Users\Anubhav.Trivedi> node -v
The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelli
ng of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:5
+ node <<<< -v
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I tried uninstalling node js and reinstalling it. Added node js path C:\Program Files (x86)\nodejs\ to enviroment variables (system variables). Restarting computer. But nothing seems to work.
Kindly let me know, what am I missing here.

These issues cannot be installed from the Package Manager console, so I had to browse lot of things to fix the issues and finally I got the solution.
Maybe we followed these scenarios
Missing Node.js software
Wrongly updated Windows environment path
Installed in the wrong path
Old version of Node.js software
You can download the latest Node.js software here.
Update Path
After installation, automatically create nodejs folder in this path “C:\Program Files (x86)” or “C:\Program Files “.
Open Control Panel -> User Accounts -> Change my environmental variable and verify the path Variable value “C:\Program Files (x86)\nodejs” or “C:\Program Files\nodejs “.
new => user = path => value = C:\Program Files (x86)\nodejs and after apply that.
and close Editor and restart it. it will work correctly.
note :- enter your path instead of copy of this path.

As dan-gph mentioned check the Path in environment variable using script $env:path -split ';' | Select-String nodejs and once you update the Path in environment variable, make sure to restart powershell and also restart explorer.exe. This would resolve the issue.
If you still face issues, check which nodejs you have installed (32bit or 64bit). Install 32 bit only as powershell or cmd are 32bit programs

Model for VSCode editor
C:\Program Files\nodejs
C:\Program Files\nodejs\node_modules\npm\bin
Search PATH environment variable.
Add the above paths into the Environment variables (both user
variable path and system variable path).
Restart VSCode.
Open a new terminal in VSCode
run node --version output should equal v16.13.0

If you installed NodeJs recently after opening the IDE like Visual Studio Code or any other IDE that includes the terminal you are trying. then try this.
Restart the IDE, If you installed NodeJs recently after opening the IDE like Visual Studio Code or any other IDE that includes the terminal you are trying.
Restart the CommandLine if you installed NodeJs after you opened the CommandLine.
I hope it will be fixed most of the time by following these simple steps.
Happy Coding!

open control panel then--
user accounts
|
user accounts
|
change my environment variables
|
new
|
(In variable name use)--Path
|
(In variable value use)C:\Program Files\nodejs
|
ok
After that just restart you terminal

chances are that you messed up with your system path, if it's the case, a very straight forward solution will be re-installing node and npm but don't forget to close and re-open powershell/cmd
Note: i thought that restarting computer has no effect on path but in an accident someone just deplug my laptop from power and after i turned it on everything was repaired and OK!

Reinstall/repair the application and close the vs code powershell

I've got the same error. Simply check below instructions. If all they are done. Just restart your computer. Then it will worked for me. I just restarted my computer.
List item
Missing Node.js software
Wrongly updated Windows environment path
Installed in the wrong path

1.find nodejs folder
go to environment variable in windows
edit path and add "find nodejs folder"
Restart computer

This issue corrected after updated my environment variable path
i just copy the path from path value in user to path value in system check image attachment.
https://i.stack.imgur.com/11uCk.png
path change image below

Go to Control Panel\System and Security\System on Windows 10.
Go to advance properties.
Advance system settings -> advance system settings -> Environment Variables Or type edit the system environment variables in the windows search.
Add "C:\Program Files\nodejs" ,"C:\Program Files\nodejs" and "C:\Program Files\nodejs\node_modules\npm\bin" to the user and system variable (path)
restart the cmd and run again.
Hope it will work.

Related

"flutter doctor" not working

I've downloaded Flutter SDK as mentioned on https://flutter.io/setup-windows/ and also extracted it. Now when I try to run any Flutter command on the flutter_console.bat or any other CLI the prompts starts blinking forever and nothing happens! I've set the path correctly. Did not find any help from web!
Try running the flutter_console.bat as Administrator
If you delete cache folder under bin to solve some installation issues, this cause a endless loop in flutter doctor. This was my case.
I had the same issue when my flutter directory wasn't located directly in my C:/ drive ("C:/flutter")
I hope you have installed plug-in of flutter and dart
for the working of flutter doctor you need to create system environment variables of - flutter, git , cmd and powershell
like show in image just copy paste path of
**your path may different **
example:
C:\flutter\bin
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Program Files\Git\cmd
C:\Program Files\Git\bin\git.exe
Encountered the same issue on windows. Try extracting the flutter folder in this path C:\Users\YourAccountName\AppData\Local.
Then edit your environment variable and add C:\Users\YourAccountName\AppData\Local\flutter\bin. This solved the issue for me.
I had the same problem, reason was our proxy. I unplugged the network cable and used mobile network of my smartphone via usb host function, that worked for me. After checking and configuring with flutter doctor every following attempt to start flutter doctor or flutter help was successful even with "normal" network.
I extracted flutter to C:\Program Files\ and had same problem. Running command prompt as Administrator did the trick for me. Or extract flutter to another dir where you don't need admin rights.
First, if in your system there is no git installed then first install git.
For my case, I just deleted the whole flutter folder. Download again, extract the folder, cut and paste to the c drive and then update both user variable path and system variable path. I added "C:\flutter\bin" this path inside user variable path and system variable path. Also make sure that:
C:\Windows\System32\WindowsPowerShell\v1.0
C:\Program Files\Git\cmd
C:\Program Files\Git\bin\git.exe
these paths are exist inside the system variable path. Finally I run "flutter doctor" and successfully it run. I also check "dart --version" and there is no problem.
(if you have any confusion about user variable path and system variable path then simply press widow button the type "env" then you will see "Edit the system Environment variables" then press enter and at the last you will see "Environment variables" clik on it and you will see 2 option for variable. One for user variable and another for system variable. select "path" for both and edit.)
My answer is somehow different, although I was using Visual Studio Code, I didn't find the flutter doctor option after pressing ctrl+shift+p.
I solved this issue after finding out, that I didn't choose the trusted system of Visual Studio.
open your path /flutter/bin
then delete cache folder
open terminal
flutter doctor -v
This will fix all problem.
you can just do this>
navigate to flutter bin
cd C:\flutter\bin
C:\flutter\bin> flutter doctor
I installed fresh right now and if you run flutter doctor with console under administrator rights it works for me. If not I have the same behavior as described in your post.
For some reason the latest version that I installed did not work! Installing lower version with same configuration worked!

Don't get GraphViz and phpDocumentor to work

I'm trying to create a php documentation on my local XAMPP host (on Windows 7) with phpDocumentor.phar (v2.). It gives me (after parsing all the files) this error:
Unable to find the dot command of the GraphViz package. Is GraphViz correctly installed and present in your path?
I searched a lot, but nothing helps. What does 'path' means? If I open a command box at any location I can start the dot.exe (which gives me no output but waiting prompt). In my environment path variable the bin folders is added. GraphViz is installed correct in Program Files and runs standalone.
What could I do or check?
In order to get GraphViz running properly with a Windows based phpdoc installation, just put the GraphViz program directory (c:\some\path\graphviz\release\bin) to the Windows Path system variable.
In order to do this, follow these steps (Win7, please provide your OS version if this doesn't apply to your situation):
From the desktop, right-click My Computer and click Properties.
In the System Properties window, click on the Advanced tab.
In the Advanced section, click the Environment Variables button.
In the Environment Variables window, highlight the Path variable in the Systems Variable section and click the Edit button.
Different directories are separated with a semicolon:
C:\Program Files;C:\Winnt;C:\Winnt\System32
It will most likely look a bit different in your enviroment, so please just take this for an example. Just add the GraphViz Path at the end like this:
C:\Program Files;C:\Winnt;C:\Winnt\System32;C:\somefolder\graphviz\release\bin
I'm not too sure if you have to reboot your system after changing this value. You had to do this in the old days of Win2k, and I just don't know if this still applies to modern Windows versions. It surely doesn't hurt!
After this, phpdoc should be able to find the dot command.
The steps to resolve this error are:
download Windows Packages from
https://graphviz.gitlab.io/_pages/Download/Download_windows.html
Just install it
add c:\Program Files\Graphviz*\dot.exe or c:\Program Files (x86)\Graphviz*\dot.exe to your environment variable PATH
run phpdoc
Re-start your machine & run phpdoc (if still shows the same error message)

Android studio doesn't start

I just download Android Studio for Windows 7, the wizard went ok up to the end but now when I click on the shortcut or on the .exe to start the program nothing happens, no error, no new window, it's seems like it is doing nothing. Do you have any suggestion?
It's a bug of Android Studio 0.1v
You should add JAVA_HOME to the system environment variables.
http://tools.android.com/knownissues#as0.1
Open Start menu > computer > System Properties > Advanced System
Properties
In the Advanced tab > Environment Variables, add new system
variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21
Install latest Java Development Kit.
Set path in system variables for Java (ie *C:\Program Files\Java\jdk1.7.0_21\bin*)
Set JDK_HOME system variable (ie *C:\Program Files\Java\jdk1.7.0_21*)
If not working, set JAVA_HOME in system variable too (ie *C:\Program Files\Java\jdk1.7.0_21*)
If not working, check if you don't have spaces at the ends of the lines in system variables (PATH, JDK_HOME, JAVA_HOME)
You don't have to restart computer after changing system variables, just reload command prompt (if you are using it).
If it still not working, you probably have java.exe in C:/Windows/System32/. Rename it, restart command prompt and type java -version to check if you are using correct version of JDK.
I've posted tutorial how to fix Android Studio with screenshots on my blog.
I have had a similar problem with Android Studio 1.0 in windows 7 x64. When I ran studio64.exe it flashed the android studio logo and it disappeared immediately. Also I tried
studio64.exe > error.log
to figure out possible errors. JAVA_HOME=C:\Program Files\Java\jre1.8.0_25 environment variable was correctly setted.
Finally I decided to uninstall all Java versions (I had a mess of different java versions installed), both jdk and jre and reinstalled last version jdk 1.8.0_25. My problem was solved.
Regards,
Sometimes it might get stuck in memory. Open task manager, terminate android stuido. Open it up again.
If you install new the version of android studio.
It requires new jdk 1.8.
Just install the latest jdk 1.8 and android studio will work without the need to manually edit any environment variables.
You have to add a new system variable named ANDROID_STUDIO_JDK or JDK_HOME with the path to your JDK install folder, such as C:\Program Files\Java\jdk1.7.0_21\
I had the same exact problem and did try to do every thing manually nothing worked except for this command when I finished it finally launched. Open CMD with administrator if possible then put the following command:
set path="$PATH":C:\Program Files\Java\jdk1.7.0_21\bin
Then just try to launch it should work.
This is the only thing that worked for me.
Make sure you have Java 1.8 (JDK) or higher and update java_home and path to this version.
I did every tips but i checked AS requirements and updated jdk do 1.8.xx
It's possible there is a problem with your username (and name of the user folder). It shouldn't contain non-latin letters.
I had solved my problem (no response to an attempt to run Android studio) when I tried running the application as another Windows user (with name that consists of English letters only)
I got the same problem, but with no error message.
I found a studio.bat file and dig in it. There, I found some tips:
I found out thet the variable suggested in a previous post is incorrect.
ANDROID_STUDIO_JDK is no good.
STUDIO_JDK is the one.
Also, just to make the things/solution worst to corner,
I've uninstalled jre and jdk then reinstall jdk only.
The setup variables are like this:
JAVA_HOME is now pointing to C:\Program Files\Java\jdk1.8.0_172\bin
JDK_HOME is pointing to C:\Program Files\Java\jdk1.8.0_172
STUDIO_JDK is pointing to C:\Program Files\Java\jdk1.8.0_172
It's a mess but it's working...
Is it because I uninstalled/reinstalled java sdk and jre? or just the env. variables? who knows :)
Specs:
i5 with 4gig ram
win 10 32bit
In addition to following the steps pointed out by Tigris I also had to run the Android Studio with Administrative rights. Not sure why but I just made it in a few minutes ago.
Follow the steps here: http://tools.android.com/knownissues#as0.1
Run Android Studio as Admin
There is Another Issue
http://tools.android.com/knownissues
open a "cmd.exe" (command prompt), cd to the android-studio\bin folder and run "studio.bat". You will most likely see an error: for example b/55267 is about the option -XX:+UseCodeCacheFlushing not being recognized. Report the error, remove the line from the studio.exe.vmoptions or studio64.exe.vmoptions and it should now work.
There could be a process still running in the background that would need to be killed in the task manager. The name of the process is studio64.exe (at least that's the name on my machine). Could be because I am running a 64-bit OS. After killing this process, try to run Android Studio again, and it should work.
If your path and/or environment variables are not pointing to the correct JDK, things won't work properly.
A rock solid solution, especially if you must have multiple JDKs installed (e.g. Java 6/7/8) is to create a batch file to launch Android Studio.
Create a new file called studio.bat and place this somewhere outside the Android Studio installation, e.g.
c:\mydevstuff\launchers\studio.bat
(if you put the batch file anywhere in the android-studio folder, then you'll have problems when updating Android Studio).
Put the following code in the new batch file:
#echo off
REM Can make paths relative to SCRIPT_PATH if necessary
set SCRIPT_PATH=%~dp0
set ANDROID_STUDIO_JDK=<JDK Path>
set JAVA_HOME=<JDK Path>
set PATH=<JDK Path>\bin;%PATH%
cd <android-studio Install Path>\bin
start studio64.exe
Replace studio64.exe with studio.exe if you need the 32-bit version.
Replace
<JDK Path>
with the path to your JDK, e.g.
C:\Program Files\Java\jdk1.7.0_25
Replace
<android-studio Install Path>
with the path to your Android Studio installation, e.g.
C:\Program Files\Android\android-studio
Now you can just run the batch file to start Android Studio.
Additional:
If you want to pin to the Taskbar, then create a shortcut to the batch file and then change it's target to:
cmd.exe /c "<path to bat>\studio.bat"
Then pin this shortcut to the Taskbar by drag-and-drop.
You can also set it's icon from the original Android Studio studio.exe file.
I ran into this problem and these steps fixed it.
Remove ALL older JRE / JDK versions
Set values for JDK_HOME & JAVA_HOME to path of JDK install
if you use android studio version 2.3.3 you should have JDK with version 1.8 in the system environment values ,
to add it
click on Computer (in windows 7)
System properties
Advanced system settings (at the right)
Advanced (tab)
environment variables button
and edit the value of name JAVA_HOME to the file which contains jdk 1.8
if you don't have this variable make a new one

Why is 'ruby' not recognized as an internal or external command?

Path in user variable is the default path from the installation:
C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby1.9.3\bin
Path in system variable is directed to:
C:\RailsInstaller\Ruby1.9.3\bin
When I open the Command Prompt with Ruby and Rails, the command prompt says "'ruby' is not recognized as an internal or external command" immediately without any input.
The command prompt worked before. After I re-installed it using various methods due to unsuccessful setup, it got like this.
How can I fix it?
Please restart cmd before running ruby command.
In Windows PC:
To add bin path of your installed ruby to PATH environmental variable
1. right click on "My Computer" -> Properties -> Advanced System Settings -> Environmental Variables -> Select "Path" ->Edit
Example path shown below:
D:\Ruby22\bin;
2. Restart cmd after changes
Refer below image:
Ruby Path setting in Windows 7 and other windows OS
So,
C:\RailsInstaller\Ruby1.9.3.\bin is the place where your ruby.exe is saved?
If that's correct, you should be able to access the ruby commands via the Command Prompt.
When you try: REG QUERY "HKCU\Environment" in the console, is there an output like?:
PATH REG_EXPAND_SZ C:\RailsInstaller\Ruby1.9.3.\bin
Ensure you have the correct x32 or x64 bit version of Ruby
installed.
Ensure you have the PATH environment variable setup, this should be
done automatically if selected upon install.
Lastly ensure you restart your command prompt.

'node' is not recognized as an internal or external command

I've been working with node.js v0.6.3, locally installed on Windows Vista at C:\Program Files\Nodejs. I recently upgraded to (by running the installer for) v0.6.6. It seemed like it worked for a while, but now if I try to run node from any directory I get a
'node' is not recognized as an internal or external command
message, though running node from C:\Program Files\Nodejs does work.
I tried rebooting, removing node, reinstalling, reinstalling 0.6.3 - nothing seems to work. I just don't get why node fails to recognize system path, though node works from its base dir?
Node is missing from the SYSTEM PATH, try this in your command line
SET PATH=C:\Program Files\Nodejs;%PATH%
and then try running node
To set this system wide you need to set in the system settings - cf - http://banagale.com/changing-your-system-path-in-windows-vista.htm
To be very clean, create a new system variable NODEJS
NODEJS="C:\Program Files\Nodejs"
Then edit the PATH in system variables and add %NODEJS%
PATH=%NODEJS%;...
Nodejs's installation adds nodejs to the path in the environment properties incorrectly.
By default it adds the following to the path:
C:\Program Files\nodejs\
The ending \ is unnecessary. Remove the \ and everything will be beautiful again.
Go to the folder in which you have Node and NPM (such as C:\Program Files (x86)\nodejs\) and type the following:
> set path=%PATH%;%CD%
> setx path "%PATH%"
From http://www.hacksparrow.com/install-node-js-and-npm-on-windows.html
Everytime I install node.js it needs a reboot and then the path is recognized.
Watch out for other paths ending in \ too. I had this:
...bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\nodejs\
and changed it to this:
bin;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files\nodejs
removing the final \, but it still didn't work. The previous path, for the Web Platform Installer, had a trailing \ too. Removing that fixed the problem.
Try adding C:\Program Files\Nodejs to your PATH environment variable. The PATH environment variable allows run executables or access files within the folders specified (separated by semicolons).
On the command prompt, the command would be set PATH=%PATH%;C:\Program Files\Nodejs.
Make sure nodejs in the PATH is in front of anything that uses node.
I set the NODEJS variable in the system control panel but the only thing that worked to set the path was to do it from command line as administrator.
SET PATH=%NODEJS%;%PATH%
Another trick is that once you set the path you must close the console and open a new one for the new path to be taken into account.
However for the regular user to be able to use node I had to run set path again not as admin and restart the computer
I have tried most of the above steps, but the issue didn't resolve. So I uninstalled and installed node.js and it worked for me.

Resources