1

I am new for Azure Custom DevOps extension. I have developed and extension and trying to use the same in Azure DevOps pipline. But facing issue as below.

"SyntaxError: Unexpected token function"

Error Screenshot

Checked for fix in the internet, many have suggested as the version of Node.js would be the issue. Hence I have added "Node.js tool installer" step also in the pipeline. But still the error is same.

Followed below links for the DevOps Custom Extension Development.

  1. https://learn.microsoft.com/en-us/azure/devops/extend/develop/add-build-task?view=azure-devops
  2. https://learn.microsoft.com/en-us/azure/developer/javascript/how-to/with-azure-sdk/stop-start-virtual-machine

Note: I am able to run the Node.js application locally and getting the expected results.

1 Answer 1

1

At the moment of writing Node executor of task is using very old node version.

To fix it specify in your task.json Node16 in execution section. For example:

"execution": {
  "Node16": {
    "target": "index.js"
  }
}
Sign up to request clarification or add additional context in comments.

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.