File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,24 @@ if (-not $WhatIf) {
17
17
Remove-Item .\package- lock.json
18
18
}
19
19
20
+ try {
21
+ Get-Command vsts- npm- auth - CommandType ExternalScript
22
+ Write-Host " vsts-npm-auth is already installed"
23
+ }
24
+ catch {
25
+ Write-Host " Installing vsts-npm-auth"
26
+ if (-not $WhatIf ) {
27
+ npm install - g vsts- npm- auth
28
+ }
29
+ }
30
+
31
+ Write-Host " Provisioning a token for the NPM registry. You might be prompted to authenticate."
32
+ if (-not $WhatIf ) {
33
+ # This command provisions a PAT token for the VSTS NPM registry that lasts for 15 minutes, which is more than enough time to run npm install
34
+ # and ensure any missing package is mirrored.
35
+ vsts- npm- auth - E 15 -F - C .\.npmrc
36
+ }
37
+
20
38
Write-Host " Running npm install"
21
39
if (-not $WhatIf ) {
22
40
npm install -- prefer- online -- include optional
You can’t perform that action at this time.
0 commit comments