I am trying to use babel-node to run files in my node project.
I am able to get them running if I set up an npm script, such as:
"scripts": {
"start": "babel-node src/index.js"
},
However, if I try to run it via the cli, I get the error: zsh: command not found: babel-node.
I've already tried installing babel-node both globally, and as a dev-dependency, via:
npm i -g @babel/node @babel/cli
But this hasn't worked for me.
Does anyone know why the shell command doesn't work?
per https://babeljs.io/docs/babel-node
so you should update your script to
And you should be able to lose the
/index.jspart, simplifying to