ApplicationInsights-node.js
ApplicationInsights-node.js copied to clipboard
Dependency incompatible with node < 18
Trying yarn add applicationinsights
on node 14.21.3
, and got
error @azure/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "14.21.3"
So I tried to resolve all incompatibilities by manually writing all dependency resolutions in package.json
, and I'm stuck here:
"resolutions": {
"applicationinsights/@azure/core-auth": "1.5.0",
"applicationinsights/@azure/core-util": "1.2.0"
},
With these 2, now yarn add applicationinsights
emits:
error @azure/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0". Got "14.21.3"
which means now it's a 2nd generation dependency having compatibility issues, and I have absolutely no idea which. Also, what if there are 10 more of these incompatibilities? I find it highly impractical, so I gave up. Any ideas?
Edit: I didn't know you can have wildcard resolutions. This works:
"resolutions": {
"@azure/core-auth": "1.5.0",
"@azure/core-util": "1.2.0"
},
Still, I feel like this is more of a workaround, because if README claims ApplicationInsights supports node 8
then it should work out of the box.