Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"react - native link error File C:\Users\pc\AppData\Roaming\npm\react-native.ps1 cannot be loaded"

Error message:

react-native : File C:\Users\pc\AppData\Roaming\npm\react-native.ps1 cannot be loaded. The
file C:\Users\pc\AppData\Roaming\npm\react-native.ps1 is not digitally signed. You cannot run
this script on the current system. For more information about running scripts and setting
execution policy, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ react-native link
+ ~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

How can I solve this? I have installed npm, Node.js and JDK. I have done the tutorial for Okta authentication and in the step of react-native link I get this error.

like image 618
Nicholas Lindartono Avatar asked Oct 21 '25 04:10

Nicholas Lindartono


1 Answers

Try setting your execution policy in PowerShell to remote signed.

Open a new PowerShell administrator window and run Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser.

There’s also a way to allow running PowerShell scripts on Windows in Settings somewhere, but I don’t remember where. Probably in Developer Settings.

like image 66
suicune Avatar answered Oct 22 '25 22:10

suicune



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!