How can i change the scripts so i can use react in my vs code

Ruta Baumane 0 Reputation points
2025-02-05T11:07:43.2266667+00:00

PS C:\Users\bauma\Desktop\Weather-react-Q> npx create-react-app .

npx : File C:\Program Files\nodejs\npx.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Polici

es at https:/go.microsoft.com/fwlink/?LinkID=135170.

At line:1 char:1

  • npx create-react-app .
  • 
        + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    
        + FullyQualifiedErrorId : UnauthorizedAccess
    
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,621 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue 39,286 Reputation points Microsoft Vendor
    2025-02-06T05:38:48.1633333+00:00

    Hi,

    The default execution policy for Windows client is restricted which prevents running of all script files. You can change the execution policy by running

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
    

    https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-executionpolicy?view=powershell-7.5

    Best Regards,

    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.