I had this code snippet working for a long time and am getting 'TypeError: Cannot read properties of undefined (reading 'match') since upgrading to v17 of node.
// -- string.js
var query = process.argv[2];
const re = /(IN|SC|ABC|QZA|DEV)\d{6,8}$/i;
const type = query.match(re)[1].toUpperCase();
I run this from a shell script (so no package.json). I have read about ESCM modules and wondering whether this is because of that and how to fix this. Not a node guru so please excuse if this has been asked in a different form before.
CodePudding user response:
The version 17 is not yet stable. You shouldn't be using it, unless you really know what you are doing. You will ran into many problems when for example using third party packages and so on. The latest stable version is 16.13.2 as it is mentioned in the official nodejs website here.
