VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. 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?
    Quote Quote  
  2. 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
    Quote Quote  
  3. 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
    Quote Quote  
  4. 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 needed
    There is nothing wrong .. with my environment
    Quote Quote  
  5. 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 typescript
    There is nothing wrong .. with my environment
    Quote Quote  
  6. This means the type script compiler is not in your path

    Originally Posted by blanc View Post
    I just opened VSC as Admin.
    The command „tsc -v“ gives out the following different error:
    [I]The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.
    There is nothing wrong .. with my environment
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!