I have the following structure.
node_modules
src
- app.js
- newrelic.js
package.json
package-lock.json
In newrelic.js its a simple class
const axios = require('axios')
export default class Newrelic {
static getName() {
return 'Hello;
}
}
in app.js
import Newrelic from "./newrelic";
console.log(Newrelic.getName())
When I run node src/app.js Sadly I receive
import Newrelic from "./newrelic";
^^^^^^^
SyntaxError: Cannot use import statement outside a module
What do I need to make this work?