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

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.

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!

Meteor on Windows 7: meteor command outputs error

Recently I installed meteor version 1.1.0.2 on my windows 7 (32bit) pc. When I create a project by meteor create myapp it creates a project for me. But after cd myapp when i press meteor command it shows an error.
Here is the error message in my cmd prompt:
C:\Users\imran\AppData\Local\.meteor\packages\meteor-tool\1.1.3\mt-os.windows.x8
6_32\dev_bundle\lib\node_modules\fibers\future.js:278
throw(ex);
^
Error: Couldn't run tasklist.exe: tasklist wasn't found on your system, it usual
ly can be found at C:\Windows\System32\.
If you can find tasklist.exe under C:\Windows\System32 then you probably don't have C:\Windows\System32 added to your PATH.
Adding C:\Windows\System32 to my PATH (environment variable) worked for me :)
i had the same problem
so i went into my Environment Variables
under system variables added new PATH (in caps)
then directed it to C:\Windows\System32
though there was a path there initially (with a whole bunch of other things pointing to different places) adding C:\Windows\System32 to this didn't seem to work for me. so i created a new one
then i ran a new cmd session as administrator.
works fine now

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

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.

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 Create" call fails in windows 7 - missing JDK

I'm having a problem getting my android dev environment setup in Windows 7. I follow the instructions here, as well as several environment sublinks. I am using Eclipse with the Android plugin. I have installed the Java JDK several times, in various locations (jdk-6u20-windows-i586.exe) - but I am obviously missing something.
Every time I run "android create avd --target 2 --name my_avd" I get an error:
C:\Users\andrew>android create avd --target 2 --name my_avd
WARNING: Java not found in your path.
Checking it it's installed in C:\Program Files\Java instead.
ERROR: No suitable Java found. In order to properly use the Android Developer
Tools, you need a suitable version of Java installed on your system. We
recommend that you install the JDK version of JavaSE, available here:
http://java.sun.com/javase/downloads/
You can find the complete Android SDK requirements here:
http://developer.android.com/sdk/requirements.html
This error message is the reason for me installing the JDK several times over. First I tried installing to a location on my e: drive. I then moved it to the default loc (program files (x86)\java\jdk.6.something. I also tried forcing it to go into the program files\ path, but it still automatically installs into the (x86) path. I have added the install path to my path environment variable every single time, yet I still continue to get this error. My suspicion is that windows 7 and the android tools are not playing together well in terms of finding the JDK, but who knows, it may be something entirely different. If you have seen this error before, I would appreciate a hint.
I had this same problem, after accidentally installed the 32-bit version of Java SDK. I uninstalled it and installed the 64-bit version (since I'm using Windows 7 64). The Android SDK setup never found Java correctly, even after I added it to my PATH variable!
After a bit of digging around, I discovered a java.exe floating around in my system32 folder, which in the order of the PATH variable came before my SDK path. After whacking the java.exe in my system32 folder, the Android Setup ran just fine!
Hope this helps.
The android command is just a Windows Batch file which in turn uses the batch file tools\lib\find_java.bat to find Java.
Having a look at the source, it does the following:
Looks to see if java.exe is on your PATH.
Looks for java.exe in somewhere under %ProgramFiles%
Your problem arises because you're using the a 64-bit version of Windows. This means %ProgramFiles% is C:\Program Files but Java is installed in C:\Program Files (x86) as it's a 32-bit application, meaning find_java.bat doesn't find it.
So to fix this you'll need to add the directory containing java.exe to your PATH environment variable.
You'll need to the add the directory containing java.exe - something like C:\Program Files (x86)\Java\jdk6\bin - on to the end of PATH with a semicolon in front of it to separate it from the previous entry.
This question on superuser.com covers maintaining Environment Variables in Windows 7.
It is really hell with JDK detection...
My params: Win 7 x64 + JDK x64 (JDK path (c:\Program Files\Java\jre7\bin)
Was googling and playing around with env variables may be 1 hour - no way.
Finally come with such solution
Manually edit android-sdk-windows\tools\lib\find_java.bat by hardcoding the path to java.exe
set java_exe=c:\Progra~1\Java\jre7\bin\java.exe
if not defined java_exe goto :CheckFailed
:SearchJavaW
set javaw_exe=c:\Progra~1\Java\jre7\bin\javaw.exe
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF
Thats works for me.
In the SDK tools folder go to libs and edit find_java.bat. It can usually be found in C:\Program Files (x86)\Android\android-sdk-windows\tools\lib.
Change all instances of %PROGRAMFILES% to %PROGRAMFILES(X86)%.
I did this and the error went away.
Find android-sdk-windows\tools\lib\find_java.bat and add something like the following:
set java_exe=
call :TestJavaDir "%JAVA_HOME%"
if defined java_exe goto :EOF
What worked for me was this:
add a path to your java/bin directory to the system Path variable. Do NOT include java.exe.
Steps on Win 7 64bit:
Click Windows Button
Right Click on Computer
Select Properties from the Context Menu
Click Advanced System Settings on the top left section
Click the Environment Variables... button at the bottom of the properties dialog
On the bottom list (System variables) find the "Path" variable
Click the Edit button
Go to the end of the textbox and type something like c:\program
files\java\jdk1.6.0_26\bin (make sure it matches the name of your
java directory!)
Click OK
Click OK
Click OK
Try it out!
hth,
\ ^ / i l l
I put rem statement in android.bat after the call command and hardcode the path of \bin\java.exe:
rem Check we have a valid Java.exe in the path.
set java_exe=<..>\jdk1.6.0_31\bin\java.exe
rem call lib\find_java.bat
if not defined java_exe goto :EOF
Same for setting other variable javaw_exe thus:
set javaw_exe=<..>\jre1.6.0_31\bin\javaw.exe
if not exist %javaw_exe% set javaw_exe=%java_exe%
goto :EOF
C:\Windows\SysWOW64
1down vote
I also had this same problem
-> accidentally installed the 32-bit version of Java SDK -> uninstalled -> installed the 64-bit version (Windows 7 64) -> -> the Android SDK setup never found Java correctly!
I discovered a java.exe floating around in C:\Windows\SysWOW64 folder.
After renaming this java.exe to javaX.exe, the Android Setup ran just fine!

Resources