0

The yaml pipeline has the following tasks added and fails with dependency install.

  • task: YarnInstaller@3 inputs: versionSpec: '1.x'

  • task: accessibility-insights@3 inputs: hostingMode: 'staticSite' staticSiteDir: '$(Build.SourcesDirectory)\out\release\ProjectPkg\Code\wwwroot' singleWorker: true uploadOutputArtifact: true failOnAccessibilityError: true

enter image description here

SYL
  • 155
  • 1
  • 14

1 Answers1

0

The Accessibility Insights for Azure DevOps Extension v3 requires Node 16 to run. As part of our extension, we set a minimumAgentVersion variable that forces ADO to use an agent running Node 16 by default.

I see in the log that the pipeline is using NODE_MODULE_VERSION 72 (Node 6) when it expects NODE_MODULE_VERSION 93 (Node 16). Is there a task before this one that is setting the Node version? If so, you may be able to remove the task that installs Node 6 and use the Node 16 environment that will come as the default on the agent version forced by the Accessibility Insights task.

If this doesn’t work, you can try adding a task, like Node.js Tool Installer, to re-install Node 16 before the Accessibility Insights task runs:

- task: NodeTool@0
  inputs:
    versionSpec: '16.x'
Katy
  • 16
  • 2
  • Added the following before the accessibility task now gives me the following error. - task: NodeTool@0 inputs: versionSpec: '6.x' Starting: accessibility-insights@3 (windows_build_container) ============================================================================== Task : Accessibility Insights Azure DevOps Task Description : Scan accessibility issues in an Azure DevOps pipeline Version : 3.0.0 Author : Accessibility Insights Help : ======================================================== – SYL Sep 20 '22 at 18:46
  • Installing runtime dependencies yarn install v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... error C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\node_modules\puppeteer: Command failed. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Exit code: 1 Command: node install.js Arguments: Directory: C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\node_modules\puppeteer Output: – SYL Sep 20 '22 at 18:48
  • C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\node_modules\puppeteer\install.js:29 async function download() { ^^^^^^^^ SyntaxError: Unexpected token function at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:549:28) at Object.Module._extensions..js (module.js:586:10) at Module.load (module.js:494:32) at tryModuleLoad (module.js:453:12) at Function.Module._load (module.js:445:3) at Module.runMain (module.js:611:10) at run (bootstrap_node.js:394:7) – SYL Sep 20 '22 at 18:48
  • at startup (bootstrap_node.js:160:9) node:child_process:902 throw err; ^ Error: Command failed: yarn install --prod --ignore-engines --frozen-lockfile at checkExecSyncError (node:child_process:828:11) at execSync (node:child_process:899:15) at installRuntimeDependencies (C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\index.js:177245:34) at Object../src/index.ts (C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\index.js:177216:63) – SYL Sep 20 '22 at 18:50
  • at __webpack_require__ (C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\index.js:195046:42) at C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\index.js:195113:37 at Object. (C:\__w\_tasks\accessibility-insights_4811a442-2fd3-5aa8-ba1a-14cb7e24c113\3.0.0\index.js:195116:12) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) { status: 1, signal: null, output: [ null, null, null ], pid: 13400, – SYL Sep 20 '22 at 18:51
  • stdout: null, stderr: null } ##[error]Exit code 1 returned from process: file name 'C:\Program Files\Docker\docker.EXE', arguments 'exec -i 5ab275e2af704919650595455100aa8081a5a6fb5a450398662d98ed5edf11e9 C:\__a\externals\node\bin\node.exe C:\__w\_temp\containerHandlerInvoker.js'. Finishing: accessibility-insights@3 (windows_build_container) – SYL Sep 20 '22 at 18:51
  • I noticed you the `versionSpec` is set to `6.x`. The pipeline requires 16. You could try: `versionSpec: '16.15.0'` to set the Node version to 16. – Katy Sep 21 '22 at 14:47