Mah*_*had 3 powershell office-addins yeoman angular project-web-addins
我想使用 yeoman 为带有 Angular 的办公室创建一个插件。在power shell中安装了nodeJs、Angular、yeoman、generator-office等需求工具后,我尝试运行此代码
yo office
Run Code Online (Sandbox Code Playgroud)
但我收到了这个错误:
yo : File C:\Users\ME\AppData\Roaming\npm\yo.ps1 cannot be loaded.
The file C:\Users\ME\AppData\Roaming\npm\yo.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
+ yo office
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Run Code Online (Sandbox Code Playgroud)
在我阅读此链接中的此错误后,我发现我应该更改“currentUser”的执行策略。
Get-ExecutionPolicy -List
Run Code Online (Sandbox Code Playgroud)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Run Code Online (Sandbox Code Playgroud)
我已经在 windows 10 pro x64、Yeoman 4.3.0、NodeJs 14.17.0、NPM 6.14.13 中进行了测试
| 归档时间: |
|
| 查看次数: |
863 次 |
| 最近记录: |