babel-node not recognized while running heroku local web
I think the most likely cause is that babel
is part of dev dependencies and those are not installed by default via official node.js buildpack. Change NPM_CONFIG_PRODUCTION
to false
and it should work.
You can use command line
heroku config:set NPM_CONFIG_PRODUCTION=false
You can always login into Heroku dyno to check if everything is installed properly
heroku run bash
You should not be using babel-node in production. It is unnecessarily heavy, with high memory usage due to the cache being stored in memory. You will also always experience a startup performance penalty as the entire app needs to be compiled on the fly.
ref: https://medium.com/@Cuadraman/how-to-use-babel-for-production-5b95e7323c2f