skip to Main Content

I’m a beginner of learning react and Node.js. When I run touch ‘index.js’ command in server, It shows
‘touch : File C:UserssanduAppDataRoamingnpmtouch.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • touch server.js
  •   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess' 
    
    

I want to know the reason to happen this.

2

Answers


  1. Chosen as BEST ANSWER

    I tried following also. It also gave me solution. Run below three commands in command prompt.

    set-ExecutionPolicy RemoteSigned -Scope CurrentUser

    Get-ExecutionPolicy

    Get-ExecutionPolicy -list


  2. Sanduni it seems like you need to set execution policy to RemoteSigned on your Powershell. Just run following command on your powershell.

    Set-ExecutionPolicy –ExecutionPolicy RemoteSigned
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search