- Upgrading Tasks to Node 10
- List of known dependency issues
- How to disable warnings for Node 6 deprecation
- Upgrade
typescript
to4.0.2
version and fix type errors. Add the following snippet to thepackage.json
:
"devDependencies": {
"typescript": "^4.0.0"
}
- Replace typings with @types
- Delete
typings
folders andtypings.json
files - Add @types packages to
package.json
dependencies.
- Delete
"dependencies": {
"@types/node": "^10.17.0",
"@types/mocha": "^5.2.7",
"@types/uuid": "^8.3.0"
...
}
-
Upgrade
azure-pipelines-task-lib
to^3.1.7
in package.json dependencies. -
Change execution handlers in
task.json
fromNode
toNode10
- Note: the
target
property should be the main file targetted for the task to execute.
- Note: the
From | To |
---|---|
"execution": {
"Node": {
"target": "bash.js",
"argumentFormat": ""
} |
"execution": {
"Node10": {
"target": "bash.js",
"argumentFormat": ""
} |
- Also in the
task.json
file, if theminimumAgentVersion
isn't present or is less than2.144.0
, change it to2.144.0
.- Agent version
2.144.0
is the first version to support Node10 handlers and theminimumAgentVersion
will trigger an automatic upgrade of2.x.y
agents less than2.144.0
.
- Agent version
"minimumAgentVersion": "2.144.0"
-
Upgrade any additional dependencies that may be incompatible with Node 10. An example is the
sync-request
package, which needs to be upgraded to the latest version from v3.0.1 See some additional dependency issues below. -
Thoroughly test tasks with unit tests and on an actual agent. The build agent now supports Node 10, so testing can be done on live versions of Azure DevOps.
-
Bumping the minimum agent version is not required, as the server will enforce a minimum version for pipelines containing Node 10 tasks.
Use the latest major version of a "common package" at common-npm-packages
folder, which depends on the azure-pipelines-task-lib
package with ^3.1.7
version.
The task-lib package uses some shared (e.g. global object) resources to operate so it may cause unexpected errors in cases when more than one version of the package is installed for a task. It happens in the case of a child package's task-lib dependency has a different version than a task's task-lib
has.
If you are planning to move some common package to common-npm-packages directory - please note that you need to update all necessary paths in this package (example of such path)
The following fs
functions all have incompatibilities. In addition, any other fs
usage should probably face extra strict scrutiny.
- fs.appendFile
- fs.chmod
- fs.chown
- fs.close
- fs.fchmod
- fs.fchown
- fs.fdatasync
- fs.fstat
- fs.fsync
- fs.ftruncate
- fs.futimes
- fs.lchmod
- fs.lchown
- fs.link
- fs.lstat
- fs.mkdir
- fs.mkdtemp
- fs.readdir
- fs.readFile
- fs.readlink
- fs.realpath
- fs.rename
- fs.rmdir
- fs.stat
- fs.truncate
- fs.unlink
- fs.utimes
- fs.write
- fs.writeFile
To avoid noise in pipeline logs - you can disable Node 6 deprecation warnings by setting up DISABLE_NODE6_DEPRECATION_WARNING agent knob in one of 2 ways:
- Set up
DISABLE_NODE6_DEPRECATION_WARNING
pipeline variable astrue
- For self-hosted agents - set up environment variable
DISABLE_NODE6_DEPRECATION_WARNING
astrue