React Course Setup FAQ

If you run into problems setting up the various React-based, Node.js-powered projects in this course check out this FAQ.

When a terminal window is mentioned below it refers to Windows Command Prompt on Windows, Windows PowerShell on Window, PowerShell Core on Windows, Mac, and Linux, Bash on Windows, Mac and Linux, and numerous other shells commonly installed on Mac and Linux.

Last Updated: 10/27/2019

The LTS version is the long term support version of Node.js. LTS versions are supported for an extended period of time and are the recommended version for most development projects and for production. The Current version is the version with newest features but those features are not needed by most developers (especially web developers) and the support for the current version ends much sooner than the long term support version. For this React classes, we recommend the LTS version, which is the version 12. If version 12 does not work for you, then please use version 10 which is latest major version explicitly supported by Create React App. Resist the tempation to upgrade to the latest Current version. We have seen problems when using these versons in the past.

To confirm your Node.js version, run the following command from a terminal window:
node -v
Ensure the output of the command is Node 8.16.0 or Node 10.16.0 or later. If you have another version of Node.js installed on your system, then we recommend installing NVM-Windows (for Windows) or NVM (for Mac & Linux). Both tools support the installation of multiple versions of Node.js and provide tools for easily switching between those versions. Using these tools, installing Node.js version 10 without losing your older version should be possible.

If you are in a corporate environment it is possible that your NPM registry is configured to download packages from an internal registry. If you are allowed, you may want to change the registry to the public NPM registry as your internal registry may be blocking you from getting the packages you need. To review you registry settings, run the follow command from the terminal:
npm config get registry
If you registry is set to then you are pulling from the public registry. If you registry is something different, then you are using an internal or private NPM server. To use the public repository simply delete the registry key. You may want to save the original registry URL so you can set it back after the installation of the React and related packages.
npm config delete registry
Then re-run the following command to verify the public registry is being used.
npm config get registry

One cool thing about NPM is that it will cache downloaded packages so when those packages are installed again they will not need to be re-downloaded. Sometimes when a package is downloaded it is corrupted but NPM does not know this. So when a broken package is installed again, the corrupted version is installed again. To clean up a broken package the cache can be verified with the following command:
npm cache verify
The verify command should repair any problems with the cache. If problems persist then the cache can be deleted with following command. NPM recommends verifying before cleaning/clearing the entire cache.
npm cache clean --force