NPM Start Error

Photo by Ann H from Pexels

This will be a short but highly significant blog post that will help many React newcomers and even some veterans as well.

I’ve lost count of the number of times I’ve initially generated a new React app project by running the command-line tool create-react-app and the name of my app, then watching the myriad of processes flash in my terminal. Then eagerly running npm start, only to be met with the line of errors below:

If you start googling the errors, you get a lot of different answers that will have you making all kinds of unnecessary coding acrobatics if you haven’t made a basic check first, that could quickly remedy this problem.

Notice what folder I’m currently in:

This seasons folder is the folder that contains my React project. I actually need to be inside of my React project folder when I run npm start. So, I simply cd into my React project folder which is named frontend_season:

Now that I’m in my React project folder, frontend_season, I can run npm start:

My back end (named backend_season) is already running on port 3000, so I get a message asking if I want to run my front end on an alternate port.

I enter Y for yes and voilà:

My React project is up and running!

So remember, when your npm start is met with a line of errors, FIRST check to make sure you’re running it from inside of your React project folder. Then you won’t be making a bunch of unnecessary changes to your app that will only make things worse.

You’re welcome!

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Krypto Camp Solidity環境建置

Java 15 is here with 14 new features

10 Things About React

JavaScript ES6+ : Var, Let and Const

How to setup Webpack +2.0 from scratch in 2017 — Part V

Intrinsic Types in TypeScript

Understand Hoisting in JavaScript

adding a select or drop down list to an Angular 9 App

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Wendy Raven McNair

Wendy Raven McNair

More from Medium

JavaScript’s Latest Trends

How You Can Serve React Build Folder From an Express Endpoint

Going Beyond React, The Beauty of Vue

Customize the style of browser errors with React