To set Node engine to 8.x or 10.x in package.json, we set the engines property.
For instance, in package.json, we write
{
"engines": {
"node": "^8 || ^10"
}
}
to add the engines property into the JSON.
We set the Node engine to 8.x or 10.x with ^8 || ^10.