Windows 10 powershell 'node' not recognized as the name of a cmdlet, function, script file, or operable program - powershell

PS C:\Users\DELL> node (OR) gcc --version (OR) g++ --version
node: The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
node
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I m having a problem with my Windows 10 Powershell, whenever I tried to get run code of (node/c++/c) via VS code I am getting an error in PowerShell, I have tried restarting my laptop also tried Restarting PowerShell and edited environment paths still I am having the same error I think my Powershell Files got corrupted! please help me I am new to Stackoverflow and A student of B.Sc.IT so my vs code editor for learning purposes is also dependent on Powershell I get totally stuck !! , Thanks in advance!
Due to Posting answer ban I m writing here hope it helps the community
Actually, I have Tried the Following ways to solve this issue on windows 10~
System Restore
Powershell Restart
Powershell Files Replace (with other window system's files in Program files..etc)
Restart PC after troubleshooting
Environment path change
but didn't anything work...
But finally after windows 11 upgrade its automatically solved my issue
I recommend you to install certain things(Apps, software, etc..)
from the official Trusted website and do not tamper with system files
unless necessary also avoid using Crack versions and multiple .NET
frameworks and installers on the same system unless necessary use only
1 INSTALLER OF .NET VISUAL STUDIO latest in my case I think it was the
problem...!!

You have to add node to your PATH. Go to System->Environment Variables->System Variables. Edit the "Path" variable and add C:\Program Files\nodejs.

Related

Unable to invoke ssh.exe in PowerShell even on providing the full path via UiPath Studio

The following works on my windows machine using PowerShell
ssh username#example.com
Now, I am trying to run the same command within PowerShell using UiPath Studio for RPA but I get the standard invalid command error -
Invoke Power Shell: the term 'ssh username#example.com' is not recognized as the name of a cmdlet, function, script file, or operable program...
However ssh.exe does exist on the machine and I even tried providing the absolute path, same result.
Are there any additional configurations to be done on the UiPath / system end to make ssh executable via UiPath Studio?
Thanks in advance
I had a similar issue with Invoke-SSH, what I did was to do Import-Module Posh-SSH, but that resulted to:
Import-Module: Could no load file or assembly 'Renci.Ssh.Net
So in UiPath Studio I went to Manage Packages and installed the Nuget package for Renci SSH. Afterwards, the Import worked, and then the Invoke-SSH command worked too.
Got this tip from this video: https://www.youtube.com/watch?v=y2VnY48MJQE&ab_channel=techu

The term '' is not recognized as the name of a cmdlet, function, script file

I am pretty new to coding and am having this issue, can't understand how to fix it, I have seen similar questions asked but, I just cant understand the majority of them. I've tried adding
the path several times, have even reinstalled Vscode it just doesn't seem to resolve.
The code I've Written::
import 'dart:io';
void main() {
print("Enter your name");
var name = stdin.readLineSync();
print("The name is $name");
}
The Error I am Getting is:
Jack : The term 'Jack' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ Jack
+ ~~~~
+ CategoryInfo : ObjectNotFound: (Jack:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I have tried:
1:Setting the Paths again
2:Reinstall vs code.
Any kind of information will really help, I can't really progress anymore because of this.
How are you running your program? When I write a program with your exact code, it works.
You have written a command line script in Dart and thus need to run it as such. For example, if you saved your program in the file my_app.dart, then from the command line you could run dart my_app.dart and it'll run your script.
Another way to run it is to create a dart console app and run it using dart run as outlined here: https://dart.dev/tutorials/server/get-started. This would be my recommendation and if you follow the guide I think you'll be able to figure it out, but to quickly confirm your code works you can do the first suggestion.

EVERYTHING is not recognized as an internal or external command, operable program or batch file IF ".EXE" SUFFIX IS MISSING

this problem might not be the problem as u may expect and I'm using Windows 7. I've guaranteed that I have put the path to EVERY SINGLE EXECUTABLE FILE I need in the %PATH%.
Yet I still can't run them nice and smooth by simply type there file name.
For instance, I've already setup my python correctly, now I open my cmd in a totally irrelevant directory, says U:\\
U:\>python
'python' is not recognized as an internal or external command,
operable program or batch file.
U:\>python.exe
Python 3.7.5 on win32
Type "help", "copyright", "credits" or "license" for more information.
And also, 'ipconfig' has the completely same issue as above:
U:\>ipconfig
'ipconfig' is not recognized as an internal or external command,
operable program or batch file.
U:\>ipconfig.exe
Windows IP Configuration
Ethernet adapter Local Area Connection: .......
What!!! How come I MUST type the extension ".exe" to make this happen? Does anyone know how to fix this?
Something messed up the PATHEXT variable on your system. This variable tells windows how to handle files with certain extensions. Or in other words, if you try to execute a file (without extension), Windows takes that variable to try to execute it with the extensions therein (in that order - so if there is a file.bat and another one file.exe and you execute just file, Windows looks into PATHEXT and then executes file.exe, because .EXE is listed before .BAT (short form - actually, also the PATH variable is involved).
On a fresh Win10, PATHEXT has the following content:
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Note, the content of PATHEXT depends on what was installed on your Windows (in your case, it's supposed to be at least:
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW
(maybe more - as I said, it depends on your configuration)
typing "start" before the program name.
If this does not work, try using the "cd" command to mount itself at the place of the program you would like to run

I can't compile Java files after Windows update! (PowerShell replaced Command Prompt.)

I can't compile any Java programs after PowerShell replaced the Command Prompt in the file menu during a Windows update. I tried using the same SET PATH command that I used with the Command Prompt (set path = c:\"Program Files"\Java\jdk1.8.0_102\bin). The java command worked, but javac was not recognized.
After learning how to access the Command Prompt (type "CMD" in the search box in the bottom left corner), I assumed everything would work like normal - but I was mistaken. The javac command SEEMED to work. It flagged errors when I first tried to compile. After fixing the errors, I thought I had an error free compile. It was when I tried to run my "newly compiled" program that I noticed that my new changes were not showing! I discovered that - in spite of it seeming to compile - no new CLASS files were being created. (It was the old CLASS files that were being run.)
I was then advised to make sure I was the administrator. I did - with PowerShell and the Command Prompt - but it made no difference.
I tried reinstalling Java - but that made no difference either.
Here is what happens when I compile as administrator from the command prompt:
C:\Users\penny\Java>Set Path=C:\"Program Files"\Java\jdk1.8.0_131\bin
C:\Users\penny\Java>javac FoodCount.java
C:\Users\penny\Java>java FoodCount
Error: Could not find or load main class FoodCount
It compiles (or seems to), but no class file is created. And, yes, the javac.exe file IS in the bin file:
C:\Program Files\Java\jdk1.8.0_131\bin>dir javac.exe
Volume in drive C is Windows
Volume Serial Number is 7040-4F22
Directory of C:\Program Files\Java\jdk1.8.0_131\bin
07/12/2017 11:48 PM 15,904 javac.exe
1 File(s) 15,904 bytes
0 Dir(s) 838,527,008,768 bytes free
This is what happened when I used a suggestion from one of the comments for PowerShell. (This was before I reinstalled Java, so the version is a little different. After reinstalling, the result was exactly the same.)
PS C:\Users\penny\Java> $env:PATH += ';c:\Program
Files\Java\jdk1.8.0_102\bin'
PS C:\Users\penny\Java> javac FoodCount.java
javac : The term 'javac' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ javac FoodCount.java
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (javac:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\penny\Java>
To sum up, I seem to be able to compile with javac.exe from the command prompt, but no new class file can be found in my directory afterwards. I cannot get PowerShell to recognize javac.exe at all.
Can anyone tell me what is going on? I think there must be something going on with the permissions, but being administrator doesn't seem to be enough.
I think Windows fixed this "bug" with another automatic update/patch!
When I tried compiling from the command prompt today, it worked! A class file was saved and I was able to run it. Yesterday, the compiler (javac.exe) seemed to work from the command prompt, but no new class file was created. I don't know why it would behave differently today - unless a Windows update fixed the problem.
I still can't get javac.exe to run in PowerShell, but I don't know what I am doing there.
If anyone else has this problem, my advice is PATIENCE. If you wait, it may go away!

Why is the Uninstall-ChocolateyPackage cmdlet not recognized?

I am trying to run a PowerShell script to uninstall owncloud-client from my Windows 10 virtual machine. The code shown below can be found at
https://chocolatey.org/packages/owncloud-client (tools\chocolateyUninstall.ps1)
I would like just to test the code by running it from PowerShell to see if it actually uninstalls the software.
$unfile = "ownCloud\uninstall.exe"
if (Test-Path "${Env:ProgramFiles(x86)}\$unfile") {
$unpath = "${Env:ProgramFiles(x86)}\$unfile"
} else {
$unpath = "${Env:ProgramFiles}\$unfile"
}
Uninstall-ChocolateyPackage 'owncloud-client' 'exe' '/S' "$unpath"
I run script from the directory that contains it by typying:
.\chocolateyUninstall.ps1
As output I get the following error:
Uninstall-ChocolateyPackage is not recognized as the name of cmdlet, function, script file, or operable program.
The Uninstall-ChocolateyPacakge.ps1 package is provided by chocolatey. I checked on my machine and this package is present under:
C:\ProgramData\chocolatey\helpers\functions\Uninstall-ChocolateyPackage.ps1
but still it is not recognized as cmdlet by powershell. How can I solve this problem? thanks
When running the installation/uninstallation scripts, Chocolatey first includes the Chocolatey PowerShell module. This is done in the background, and normally, the end user doesn't need to worry about it.
For what you are trying to do, you will need to first do an Import-Module on the Chocolatey module, to bring it into the current PowerShell session. You can find this here:
old: C:\ProgramData\chocolatey\lib\chocolatey\tools\chocolateyInstall\helpers\chocolateyInstaller.psm1
new: C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1
That should allow you to test the script directly.
Alternatively, you could run the install of the package, and then run the uninstall to see if it works as well.
With the latest moderation tools, you don't need to check every package (I mean, unless it makes you feel safer). You can always check the automated tests. There's a status dot to the right of the package title.
You can find the test summary
owncloud-client v2.1.1.5837 - Passed - Package Test Results
https://chocolatey.org/packages/owncloud-client/2.1.1.5837
Tested 10 Feb 2016 12:51:22 +00:00
Tested against win2012r2x64 (Windows Server 2012 R2 x64)
Tested with the latest version of choco, possibly a beta version.
Tested with chocolatey-package-verifier service v0.4.0-15-g979d0cc
Install was successful.
Uninstall was successful.
https://gist.github.com/choco-bot/45f343e23cc12e101130#file-_summary-md
or explore the uninstall log directly.
https://gist.github.com/choco-bot/45f343e23cc12e101130#file-uninstall-txt