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

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

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

see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ ng add @angular/material
+ ~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + 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
远程签名
范围执行策略

MachinePolicy       Undefined
   UserPolicy       Undefined
      Process       Undefined
  CurrentUser    RemoteSigned
 LocalMachine       Undefined

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

_                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/

Angular CLI: 12.0.3
Node: 14.15.3
Package Manager: npm 6.14.9
OS: win32 x64

Angular: 12.0.3
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1200.3
@angular-devkit/build-angular   12.0.3
@angular-devkit/core            12.0.3
@angular-devkit/schematics      12.0.3
@schematics/angular             12.0.3
rxjs                            6.6.7
typescript                      4.2.4

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

ℹ Using package manager: npm
✔ Found compatible package version: @angular/material@12.0.3.
✔ Package information loaded.

The package @angular/material@12.0.3 will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
? Choose a prebuilt theme name, or "custom" for a custom theme: Indigo/Pink   ngular.io?theme=indigo-pink ]
? Set up global Angular Material typography styles? Yes
? Set up browser animations for Angular Material? Yes
UPDATE package.json (1137 bytes)
✔ Packages installed successfully.
UPDATE src/app/app.module.ts (502 bytes)
UPDATE angular.json (3260 bytes)
UPDATE src/index.html (577 bytes)
UPDATE src/styles.css (181 bytes)

相关问题