When using PowerShell to create Vue project, the following error occurred, resulting in creation failure:
vue : The file D:\Program Files\nodejs\node_global\vue.ps1 could not be loaded, because running scripts is disabled on this system. For more information, see about_Execution_Policies in https:/go.microsoft.com/fwlink/?LinkID=135170
1. PowerShell’s execution policy prevented the operation.
Get-ExecutionPolicy Check and find that the execution policy is restricted:
PS D:\workspace\test> Get-ExecutionPolicy Restricted
At the same time, PowerShell gives us the method to solve the problem
2. At this time, enter the command set executionpolicy – scope currentuser as required, press enter, enter remotesigned in the black window to release the restricted status, press enter, execute the policy change, and select y
PS D:\workspace\test> Set-ExecutionPolicy -Scope CurrentUser cmdlet Set-ExecutionPolicy in command pipeline location 1 Please provide values for the following parameters: ExecutionPolicy: RemoteSigned Execution Policy Changes The execution policy helps you prevent the execution of untrusted scripts. Changing the execution policy may create a security risk, as shown in https:/go.microsoft.com/fwlink/?LinkID=135170 as described in the about_Execution_Policies help topic. Do you want to change the execution policy? [Y] Yes(Y) [A] All Yes(A) [N] No(N) [L] All No(L) [S] Suspend(S) [?] Help (default value is "N"): y
3. Next, let’s check the restricted status, Enter get executionpolicy, and the result will be remotesigned, so that we can create it normally
PS D:\workspace\test> Get-ExecutionPolicy RemoteSigned PS D:\workspace\test>
- [Solved] PowerShell Error: the script is prohibited from running on this system
- Solve the problem that vs code cannot run the script
- [Solved] yarn: Unable to load the File C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, Because running scripts is prohibited on this system.
- [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
- [Solved] TSC Compile TS File Error: TSC: the file cannot be loaded because running scripts is prohibited on this system;
- Gulp Serve Error: gulp.ps1 [How to Solve]
- [Solved] Failed to load the file C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, because script execution is prohibited in this system.
- 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] Module build failed: Error: Cannot find module ‘node-sass’