Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Elizabeth Petersen
Elizabeth Petersen
1,036 Points

Unable to open my new app (create-react-app) using npm start

I have been through the majority of the accepted steps* to resolve why I am unable to start my new app, and I continue to get this message: react-scripts: command not found.

This confounds me, because I have previously been successful in using create-react-app and having my app run in both dev and prod modes.

*Steps I have undertaken: 1) Delete node_modules and package-lock.json and reinstalling using npm i 2) Checking my webpack version using npm ls webpack 3) Adding a dotenv file with SKIP_PREFLIGHT_CHECK=true included

I will appreciate further insights.

Elizabeth Petersen
Elizabeth Petersen
1,036 Points

And... now my previously successful project will not open. :/

Cooper Runstein
Cooper Runstein
11,850 Points

Have you tried using yarn instead of npm?

Elizabeth Petersen
Elizabeth Petersen
1,036 Points

Cooper, I have not tried yarn but that will be my next step. Thank you.

Cooper Runstein
Cooper Runstein
11,850 Points

Let me know if that doesn't work, if it does, it's a good sign that npm needs to be reinstalled or updated, if it doesn't, you should reinstall both node and npm, you should also update to create react app 2 if you haven't, or conversely, downgrade to 1.x and see if that's the problem.

Elizabeth Petersen
Elizabeth Petersen
1,036 Points

Hey, Cooper. No, yarn didn't work. I'll uninstall and reinstall both my node and npm, and give it another try. Thanks for your persistence in helping. It's appreciated.

Cooper Runstein
Cooper Runstein
11,850 Points

React-scripts not found makes me guess it's more likely a creat-react-app issue, but I'm not positive

Elizabeth Petersen
Elizabeth Petersen
1,036 Points

Perhaps.

It seems odd, given that a month ago I successfully started a small project and now am unable to run either the new one or the old one. As soon as I figure out what needs changing, I'll post, in hopes I can help others.

Cooper Runstein
Cooper Runstein
11,850 Points

This almost certainly happened because something was updated or deleted, but it's hard to say what. The three options are your OS, something related to js, or something related to creat-react-app. But without more info it's really hard to say which it is.

Elizabeth Petersen
Elizabeth Petersen
1,036 Points

Cooper: The solution in my situation was to uninstall create-react-app globally and then instantiate a new app using npx. Works like a charm! Thanks for your input and assistance.

1 Answer

Template not provided, must likely you are running an outdated version of create react app.(about two weeks old).Please note that global installs of create react app are no longer supported. I'm up shit creek without a paddle. Where was this made public on treehouse?