Error: Couldn't find preset "es2015" relative to directory "/app"


#1

Hello,

my (react/redux) app works locally. I am trying to deploy it to Heroku, and the Heroku logs show the following error message :

Error: Couldn't find preset "es2015" relative to directory "/app"

Would you have any suggestion how to move on with this error ? I’m not sure what is missing here.

My start script in package.json is as follows :

“babel-node server/index.js”

I have a .babelrc file at the root folder with the following in it :

{
	"presets": ["es2015", "react"]
}

#2

Same , I am having a same problem when I deploying a react/


#3

First, you should note that it has been advised not to use babel-node in production.

If you must use it, list the preset in your dependencies directly (package.json) and not in devdependencies. Heroku, as far as I know does not install your devdependencies for production.

Alternatively, build your app locally, and push the built app to heroku. Then your start command can simply be node index.js.