Problem Description: yarn is used in vscode terminal to report an error
Specific error information:
yarn: Unable to load the File C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, Because running scripts is prohibited on this system. For more information, please refer to https:/go.microsoft.com/fwlink/?LinkID=135170
About_Execution_Policies.
Location Line: 1 Character: 1
+ ~~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Solution:
1. Open windows PowerShell in administrator mode (the general shortcut key win + X can wake up for selection)
2. Enter get executionpolicy
in PowerShell and return restricted
3. PowerShell input set executionpolicy remotesigned
4. PowerShell returns the result and enters y for setting
Execute policy changes
Execution strategies can help you prevent the execution of untrusted scripts. Changing the execution strategy may create security risks, such as https:/go.microsoft.com/fwlink/?LinkID=135170
As described in the about_Execution_Policies help topic. Do you want to change the execution strategy?
[Y] Yes (Y) [A] All Yes (A) [N] No (N) [L] All No (L) [S] Pause (S) [?] Help (default is "N"):
Similar Posts:
- [Solved] Vue : The file D:\Program Files\nodejs\node_global\vue.ps1 could not be loaded, because running scripts is disabled on this system.
- Gulp Serve Error: gulp.ps1 [How to Solve]
- [Solved] PowerShell Error: the script is prohibited from running on this system
- [Solved] Failed to load the file C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, because script execution is prohibited in this system.
- [Solved] TSC Compile TS File Error: TSC: the file cannot be loaded because running scripts is prohibited on this system;
- Solve the problem that vs code cannot run the script
- Modify the script execution permission of PowerShell, and solve the problem of error reporting of commands executed by built-in terminals such as vscode (XX cannot recognize the name of cmdlets, functions, script files or runnable programs)
- [Solved] VScode cmpm Error: cnmp: Cannot Loading the File…
- An error is reported when running cnpm in vscode, indicating that the script cannot be run
- Error when opening windows PowerShell modules