Compiling Script files using npm start, getting errors: use strict: not found Syntax error: "(" unexpected or Syntax error: word unexpected (expecting ")")
Here is my code, index.js:
"use strict";
const getBtnEvent = document.querySelector("button");
getBtnEvent === null || getBtnEvent === void 0 ? void 0 : getBtnEvent.addEventListener('click', () => {
console.log('Clicked the button' + getBtnEvent);
});
//# sourceMappingURL=index.js.map
I've been using ES6 for above code and node version 18.*
checked for javascript version, npm start file, npm dependencies