【报错】vue create xxxx

PS C:\Users\a-xiaobodou\OneDrive - Microsoft\Projects\Vue+Flask> vue create my-project-from-uaine
vue : File C:\Users\a-xiaobodou\AppData\Roaming\npm\vue.ps1 cannot be loaded. The file C:\Users\a-xiaobodou\AppData\Roaming\npm\vue.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
+ vue create my-project-from-uaine
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess  

解决方法:

这个错误提示是由于您的系统阻止了未签名的脚本运行。为了解决这个问题,您可以尝试以下方法:

  1. 允许运行未签名的脚本:

    • 打开 PowerShell。
    • 输入以下命令来允许运行未签名的脚本:Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force
  2. 使用 Vue CLI 创建项目:

    • 打开 PowerShell。
    • 导航到您的项目目录:cd C:\Users\a-xiaobodou\OneDrive - Microsoft\Projects\Vue+Flask
    • 使用 Vue CLI 创建项目:vue create my-project-from-uaine

请注意,第一个方法可能会导致安全风险,因为它允许运行任何未签名的脚本。因此,如果您不确定如何安全地设置执行策略,请勿尝试该方法。如果您只是要运行 Vue CLI 命令,建议使用第二个方法。

PS C:\Users\a-xiaobodou\OneDrive - Microsoft\Projects\Vue+Flask> vue create my-project-from-uaine
vue : File C:\Users\a-xiaobodou\AppData\Roaming\npm\vue.ps1 cannot be loaded. The file C:\Users\a-xiaobodou\AppData\Roaming\npm\vue.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
+ vue create my-project-from-uaine
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\a-xiaobodou\OneDrive - Microsoft\Projects\Vue+Flask> Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process -Force
PS C:\Users\a-xiaobodou\OneDrive - Microsoft\Projects\Vue+Flask> vue create my-project-from-uaine
?  Your connection to the default npm registry seems to be slow.
   Use https://registry.npmmirror.com for faster installation? Yes


Vue CLI v5.0.8
? Please pick a preset: Default ([Vue 3] babel, eslint)


Vue CLI v5.0.8
✨  Creating project in C:\Users\a-xiaobodou\OneDrive - Microsoft\Projects\Vue+Flask\my-project-from-uaine.
🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...


added 861 packages in 2m
🚀  Invoking generators...
📦  Installing additional dependencies...


added 101 packages in 26s
⚓  Running completion hooks...

📄  Generating README.md...

🎉  Successfully created project my-project-from-uaine.
👉  Get started with the following commands:

 $ cd my-project-from-uaine
 $ npm run serve

PS C:\Users\a-xiaobodou\OneDrive - Microsoft\Projects\Vue+Flask>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值