Production Builds

This is related to Video 3 - Production Builds of the Deployment section in Mosh’s React course.

I’ve installed npm i -g serve, but when I run serve -s build, I just get command not found.

If i run npm serve -s build, I get:

Specify configs in the ini-formatted file:

Any idea how to make this work?

Try npx serve -s build or create a new terminal session and run serve -s build

After you globally install a new binary, that binary is sometimes not available in your current PATH or terminal session (depends on what OS/shell you are using)

npx is similar to npm exec - which basically lets you exec a binary of a package installed in the current node project.