Skip to content
Advertisement

How to setup react properly

I have been following the react setup instructions on codecademy:

When I type in “npm run build” into the terminal I get this error:

I can’t seem to figure out how to get it to work.

Here is the link to my code on my github: https://github.com/throwkill999/react_demo

Advertisement

Answer

The error tells you that output.build is not a valid option. You probably meant to use output.path. There are other problems with how you concatenate __dirname in some places, because you need a leading / for them. But it’s better to use path.resolve for that.

Your config would look like this:

JavaScript

Also in ./app/index.js you have a typo, it should be ./components/Apps (you forgot the s).

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement