如果您必须在VisualStudio代码中安装包期间在angularjs中发现此类问题,请执行以下步骤

sg3maiej  于 2021-09-29  发布在  Java
关注(0)|答案(1)|浏览(402)

ps c:\code\projects\exam portal\examfront>ng add@angular/material

  1. see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
  2. At line:1 char:1
  3. + ng add @angular/material
  4. + ~~
  5. + CategoryInfo : SecurityError: (:) [], PSSecurityException
  6. + FullyQualifiedErrorId : UnauthorizedAccess
1mrurvl1

1mrurvl11#

步骤1:>ps c:\code\projects\exam portal\examfront>set executionpolicy remotesigned-s
步骤2:>ps c:\code\projects\exam门户\examfront>get executionpolicy
远程签名
范围执行策略

  1. MachinePolicy Undefined
  2. UserPolicy Undefined
  3. Process Undefined
  4. CurrentUser RemoteSigned
  5. LocalMachine Undefined

步骤3:>ps c:\code\projects\exam-front>ng——版本

  1. _ _ ____ _ ___
  2. / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
  3. / △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
  4. / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
  5. /_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
  6. |___/
  7. Angular CLI: 12.0.3
  8. Node: 14.15.3
  9. Package Manager: npm 6.14.9
  10. OS: win32 x64
  11. Angular: 12.0.3
  12. ... platform-browser, platform-browser-dynamic, router
  13. Package Version
  14. ---------------------------------------------------------
  15. @angular-devkit/architect 0.1200.3
  16. @angular-devkit/build-angular 12.0.3
  17. @angular-devkit/core 12.0.3
  18. @angular-devkit/schematics 12.0.3
  19. @schematics/angular 12.0.3
  20. rxjs 6.6.7
  21. typescript 4.2.4

步骤4:>ps c:\code\projects\exam portal\examfront>ng add@angular/material

  1. Using package manager: npm
  2. Found compatible package version: @angular/material@12.0.3.
  3. Package information loaded.
  4. The package @angular/material@12.0.3 will be installed and executed.
  5. Would you like to proceed? Yes
  6. Package successfully installed.
  7. ? Choose a prebuilt theme name, or "custom" for a custom theme: Indigo/Pink ngular.io?theme=indigo-pink ]
  8. ? Set up global Angular Material typography styles? Yes
  9. ? Set up browser animations for Angular Material? Yes
  10. UPDATE package.json (1137 bytes)
  11. Packages installed successfully.
  12. UPDATE src/app/app.module.ts (502 bytes)
  13. UPDATE angular.json (3260 bytes)
  14. UPDATE src/index.html (577 bytes)
  15. UPDATE src/styles.css (181 bytes)
展开查看全部

相关问题