创建vue项目时报如下错误:
vue : 无法加载文件 D:\yizhao\html-files\file\node\node_global\vue.ps1,因为在此系统上禁止运行脚本。有关详细
信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
- vue --version
-
- CategoryInfo : SecurityError: (😃 [],PSSecurityException
- FullyQualifiedErrorId : UnauthorizedAccess
解决办法:
1.找见开始菜单,右键: 以管理员身份运行PowerShell
2. 执行:get-ExecutionPolicy,回复Restricted,表示状态是禁止的
3. 3.执行:set-ExecutionPolicy RemoteSigned即可
一定要以管理员的身份运行PowerShell,不是cmd窗口!