cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.28k stars 3.19k forks source link

Error "cannot be loaded because running scripts is disabled on this " #6059

Closed Kailash1980 closed 4 years ago

Kailash1980 commented 4 years ago

Hi, After installing 3.8.1 I am getting the following error when I run node_modules.bin\cypress open in terminal

node_modules\.bin\cypress : File D:\CypressAutomation\node_modules\.bin\cypress.ps1
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ node_modules\.bin\cypress open
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
Kailash1980 commented 4 years ago

I found the solution

I have faced the same problem

Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

mayankjain2020 commented 4 years ago

Hello, I have tried the above command still facing the issue. Could you please help with this. After running the above command as an administrator it working fine thanks for your help.

romanichh commented 4 years ago

Hello, I have tried the above command still facing the issue. Could you please help with this. After running the above command as an administrator it working fine thanks for your help.

Thank you for your solution to run as administrator. It has taken a time to me to understand where is a problem.

maniziva commented 4 years ago

I found the solution

I have faced the same problem

Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

@Kailash1980 Thank you for the solution. Now its working fine.

YuhuiRainie commented 3 years ago

I found the solution

I have faced the same problem

Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

Thx, just right-click PowerShell and then select run as administrator! Everything will be fine afterwards!

moutushisen commented 3 years ago

I found the solution

I have faced the same problem

Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

Thanks for solution now it's working fn.

Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

sainithin1529 commented 3 years ago

I followed above but I am getting same issue please help someone PS C:\Users\Nikesh> Run Set-ExecutionPolicy RemoteSigned Run : The term 'Run' 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

PS C:\Users\Nikesh> PS C:\Users\Nikesh> ExecutionPolicy RemoteSigned Get-ExecutionPolicy : Cannot bind parameter 'Scope'. Cannot convert value "RemoteSigned" to type "Microsoft.PowerShell.ExecutionPolicyScope". Error: "Unable to match the identifier name RemoteSigned to a valid enumerator name. Specify one of the following enumerator names and try again: Process, CurrentUser, LocalMachine, UserPolicy, MachinePolicy" At line:1 char:17

Premsing commented 3 years ago

I found the solution

I have faced the same problem

Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

Not helping

rahulpreeti commented 2 years ago

Set_execution_policy

rahulpreeti commented 2 years ago

do not use "Run" word with the command You have to execute only "Run Set-ExecutionPolicy RemoteSigned" if you get error on running above command, Check instruction displaying in result I executed "Set-ExecutionPolicy -Scope CurrentUser" it will ask you set ExecutionPolicy, enter "RemoteSigned" & hit enter key then enter "Yes" or "Y" & hit enter key

IPrasadMCA commented 2 years ago

If anyone still unable to resolve this issue with above conditions... You can use below command by opening Windows PowerShell by clicking on Run as Administrator Set-ExecutionPolicy Unrestricted and click on 'Y", Then problem will be resolved image

Feruzka1706 commented 2 years ago

do not use "Run" word with the command You have to execute only "Run Set-ExecutionPolicy RemoteSigned" if you get error on running above command, Check instruction displaying in result I executed "Set-ExecutionPolicy -Scope CurrentUser" it will ask you set ExecutionPolicy, enter "RemoteSigned" & hit enter key then enter "Yes" or "Y" & hit enter key

Thank you so much! It's working now!

Richa729 commented 2 years ago

I found the solution

I have faced the same problem

Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

it worked for me thanks

nimmyranjee commented 2 years ago

I was able to resolve as an admin . Thanks

hanamthai commented 2 years ago

I fixed the error, thanks.

malithheshantha commented 2 years ago

If anyone still unable to resolve this issue with above conditions... You can use below command by opening Windows PowerShell by clicking on Run as Administrator Set-ExecutionPolicy Unrestricted and click on 'Y", Then problem will be resolved image

Thank you it worked

AkshayKDeshmukh commented 2 years ago

Thanks @Kailash1980, The solution worked for me as well.

rupak-bhuyan commented 1 year ago

do not use "Run" word with the command You have to execute only "Set-ExecutionPolicy RemoteSigned" if you get error on running above command,then use command. Set-ExecutionPolicy -Scope CurrentUser it will ask you set ExecutionPolicy, enter "RemoteSigned" & hit enter key then enter "Yes" or "Y" & hit enter key

GeeTechh77 commented 1 year ago

I found the solution I have faced the same problem Solution : In Window:: Open Windows PowerShell Run Set-ExecutionPolicy RemoteSigned Type Yes Now Run run command ./node_modules/.bin/cypress run Test runner will work properly

Not helping

You have to open Windows power shell in administrator mode

GeeTechh77 commented 1 year ago

image

If you face the above issue while running Ui 5 tooling solution Is below

Open Windows power shell – open in administration mode. image