0

i have looked all over the internet and cant find a way to fix my problem. The following is the commands i did

C:\Users\Angengos>create-react-app learn-react

Creating a new React app in C:\Users\Angengos\learn-react.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...


> [email protected] postinstall C:\Users\Angengos\learn-react\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall C:\Users\Angengos\learn-react\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall C:\Users\Angengos\learn-react\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"


> [email protected] postinstall C:\Users\Angengos\learn-react\node_modules\ajv
> opencollective-postinstall || true

+ [email protected]
+ [email protected]
+ [email protected]
added 1606 packages from 751 contributors and audited 931219 packages in 904.669s

58 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


A template was not provided. This is likely because you're using an outdated version of create-react-app.
Please note that global installs of create-react-app are no longer supported.

C:\Users\Angengos>cd learn-react/

C:\Users\Angengos\learn-react>npm start
npm ERR! missing script: start

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Angengos\AppData\Roaming\npm-cache\_logs\2020-04-19T17_42_57_484Z-debug.log

C:\Users\Angengos\learn-react>

AND THIS IS THE PACKAGE.json

{
  "name": "learn-react",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.1"
  }
}

AND HERE IS THE NODE AND NPM VERSION

C:\Users\Angengos\learn-react>node --version v12.16.2

C:\Users\Angengos\learn-react>npm --version 6.14.4

1
  • npx create-react-app learn-react Read here Commented Apr 19, 2020 at 18:24

1 Answer 1

1

Seems the scripts are not in you package json. Add this and yry again:

"scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" },

It should look like this:

{
  "name": "learn-react",
  "version": "0.1.0",
  "private": true,
  "scripts": {
      "start": "react-scripts start",
      "build": "react-scripts build",
      "test": "react-scripts test",
      "eject": "react-scripts eject"
},
  "dependencies": {
     "react": "^16.13.1",
    "react-dom": "^16.13.1",
   "react-scripts": "3.4.1"
  }
}
Sign up to request clarification or add additional context in comments.

3 Comments

With npx create-react-app user does not have to add dependencies
I know, the scripts part should be in the package.json as soon as he creates the app but the problem he's got its the start script is not in the package.json, if he does not want to create the app again that should work.
Your solution suggests that they already created the app and got an incorrect package.json, but doesn't the fact that they are using create-react-app mean they are anyway creating it at the moment for the first time, so might as well do it correctly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.