[Solved] PowerShell in Windows 11 does not recognize the vue command and a red error appears

[Solved] PowerShell in Windows 11 does not recognize the vue command and a red error appears

1. Analysis

When we use the vue command to create a project, the following error occurs

Insert image description here

Follow the prompts and enter the official website to view:https:/go.microsoft.com/fwlink/?LinkID=135170

It's all a matter of PowerShell execution policies, because in PowerShell, Windows enforces some policies to limit PowerShell's ability to execute scripts.

2. Solve

Enforcement policies are not security systems that restrict user actions. For example, when a user cannot run a script, the policy can be easily bypassed by typing the contents of the script into the command line. In contrast, enforcement policies help users set ground rules and prevent them from inadvertently violating those rules.

You can modify the execution strategy with the following command

  • set-ExecutionPolicy RemoteSigned: The script can be executed without restrictions. Executing this command can solve the problems encountered in this article.
  • set-ExecutionPolicy Default:Default execution strategy

Open PowerShell as administrator

Insert image description here

Modify execution strategy

Insert image description here

problem solved

Guess you like

Origin blog.csdn.net/bugu_hhh/article/details/129683019