Hi,
I’ve just installed Visual Studio Code on my Windows 8.1 laptop. In Windows console it looks OK:
- tsc –v
- Version 5.9.3
but in VSC terminal the same command fails:
- tsc –v
- VSC: Unable to load the file C: \ Users \ Administrator \ AppData \ Roaming \ npm \ TSC.PS1, because the script is prohibited on this system."
+ CategoryInfo : SecurityError: ([],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
What can be the reason?
+ Reply to Thread
Results 1 to 6 of 6
-
-
1- open terminal as administrator, and try - tsc –v again.
This should work ..
if it doesn't then try method 2:
## File Path Analysis
<b>Path Location</b>: <code>C:\Users\Administrator\AppData\Roaming\npm\T SC.PS1</code>
### Components of the Path
- <b>C:</b> Root drive (typically the main system drive)
- <b>Users\Administrator</b>: User profile for the Administrator account
- <b>AppData\Roaming</b>: Application data folder that roams with the user profile
- <b>npm</b>: Node Package Manager directory
- <b>TSC.PS1</b>: A PowerShell script file related to TypeScript
### Likely Purpose
This appears to be a <b>TypeScript compiler (tsc) script</b> installed via npm (Node Package Manager) that allows you to run the TypeScript compiler through a PowerShell script.
### Typical Use Cases
- TypeScript compilation
- Build processes
- Development environment setup
If you don't need TypeScript functionality, rename TSC.PS1 to TSC.bak.There is nothing wrong .. with my environment -
I just opened VSC as Admin. The command „tsc -v“ gives out the following different error:
The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.
+ CategoryInfo : ObjectNotFound: (tsc:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException -
The command `tsc -v` is used to check the version of TypeScript
installed on your system. Let me break this down for you:
## TypeScript Version Check
<b>The command `tsc -v` (or `tsc --version`) will display the
currently installed version of the TypeScript compiler</b>.
### Prerequisites
- Ensure Node.js is installed
- TypeScript must be installed globally or in your project
### Typical Output
When you run this command, you'll see something like:
Version X.X.X
### Troubleshooting
If the command doesn't work, you might need to:
- Install TypeScript globally using npm: `npm install -g typescript`
- Verify Node.js and npm are correctly installed
- Check your system's PATH environment variable
### Debugging Tip
If you encounter any issues, try:
- Checking Node.js version: `node -v`
- Checking npm version: `npm -v`
- Reinstalling TypeScript globally if neededThere is nothing wrong .. with my environment -
Always run PowerShell as an Administrator when modifying execution policies or system-wide settings.
Potential Causes of PowerShell Script Execution Error
| Error Type | Possible Reason | Recommended Solution |
|-----------|-----------------|----------------------|
| Execution Policy Restriction | PowerShell's default security settings prevent running unsigned scripts | Change execution policy |
| Permission Issues | Insufficient user privileges | Run PowerShell as Administrator |
| Script Signing | Script is not digitally signed | Unblock file or modify execution policy |
Recommended Troubleshooting Steps
1. Check Current Execution Policy
Get-ExecutionPolicy
2. Modify Execution Policy
If the policy is Restricted, you'll need to change it:
Recommended for Most Users
Set-ExecutionPolicy RemoteSigned
#3. Unblock TypeScript Installation Script
Unblock-File -Path "C:\Users\Administrator\AppData\Roaming\npm\tsc.ps 1"
#4. Verify TypeScript Installation
npm list -g typescriptThere is nothing wrong .. with my environment -
There is nothing wrong .. with my environment
Similar Threads
-
"code":400,"error":true,"message" on http://getwvkeys.cc
By johnsonkiss in forum Video Streaming DownloadingReplies: 14Last Post: 25th Jul 2024, 22:45 -
YT-DLP "-o" and "--parse-metadata" for custom "File.name"
By pssh in forum Video Streaming DownloadingReplies: 2Last Post: 30th May 2024, 10:03 -
getwvkeys.cc code":400,"error":true,"message":"Failed to get license: 405
By Koldunas in forum Newbie / General discussionsReplies: 0Last Post: 27th Sep 2023, 03:44 -
Stripping "Writing Library" & "Encoding Settings" Metadata Off a File While
By simon744 in forum Video ConversionReplies: 0Last Post: 14th Aug 2023, 11:53 -
{"code": 2048, "message": "Authentication failed"} when getting license
By warmachine in forum Video Streaming DownloadingReplies: 2Last Post: 26th May 2023, 17:34


[],PSSecurityException
Quote