我想创建一个VS Code扩展来解决一些问题,我还安装了一些必要的软件包
npm install -g yo generator-code
哟和全局生成器代码,但在此之后当我输入命令时
yo code
i got error:
yo : File C:\Users\faaaast\AppData\Roaming\npm\yo.ps1 cannot be loaded because running scripts is
disabled on this system. For more information, see about_Execution_Policies at
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ yo code
+ ~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
运行“yo code”命令后我期望的问题是:
# ? What type of extension do you want to create? New Extension (TypeScript)
# ? What's the name of your extension? HelloWorld
### Press <Enter> to choose default for all options below ###
# ? What's the identifier of your extension? helloworld
# ? What's the description of your extension? LEAVE BLANK
# ? Initialize a git repository? Yes
# ? Bundle the source code with webpack? No
# ? Which package manager to use? npm
# ? Do you want to open the new folder with Visual Studio Code? Open with `code`
尝试了这三个命令:
set-ExecutionPolicy RemoteSigned -Scope CurrentUser 获取执行策略 获取执行策略-列表
如果有人遇到这些错误,请在 powershell 中尝试这些命令