9

In Azure DevOps, the pipeline fails at the npm run build step with an error in one of the indirect dependencies (check line 18 below). The error is jest-worker/build/index.js:110 _ending; SyntaxError: Unexpected token ";"

enter image description here.

The pipeline.yaml is this:

trigger:
- master

pool:
  vmImage: ubuntu-latest

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js'

- script: |
    npm install
  displayName: 'npm install '

- script: |
    npm run build
  displayName: 'npm run build'
  
- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: 'build'
    includeRootFolder: true
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
    replaceExistingArchive: true

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'
0

2 Answers 2

2

SyntaxError: Unexpected token ";"

Your pipeline.yaml is using an extremely old version of Node.js. Your question is from 2 months ago, so I presume this is incorrect.

Solution

In your pipeline file (sometimes called azure-pipelines.yml), update

versionSpec: '10.x'

to

versionSpec: '16.x'

or whatever your project's version of Node.js* is, and rerun your pipeline.

*You can check your project's version of Node.js in its package.json.

Sign up to request clarification or add additional context in comments.

Comments

1

I solved this by changing version of Node.js to '16.x'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.