Create React App not working

前端 未结 15 1338
清歌不尽
清歌不尽 2020-12-29 06:30

Help! I have no idea what is going on here, create react app is not working I have also tried reinstalling and yet to no avail, please help!

Npm version: 5

相关标签:
15条回答
  • 2020-12-29 06:57

    on Ubuntu 18.04

    sudo npm cache clean -f
    sudo npm install -g n
    sudo n stable
    
    0 讨论(0)
  • 2020-12-29 06:58

    It sets up your development environment so that you can use the latest JavaScript features, provides a nice developer experience, and optimizes your app for production.

    You’ll need to have Node >= 8.10 and npm >= 5.6 on your machine. To create a project, run:

    npx create-react-app my-app

    cd my-app

    npm start

    Note: npx on the first line is not a typo — it’s a package runner tool that comes with npm 5.2+.

    Create react app provides more information regarding this.

    It may be the problem of cache also, so can also try:

    npm cache clean --force

    Edit 1: This may be due to slow internet speed, Please check the internet and try again.

    0 讨论(0)
  • 2020-12-29 07:04

    I had the same problem, and I solved it by:
    1. update the npm version (npm install npm@latest -g)
    2. clear the cache (npm cache clean --force)
    3. create the react project (npx create-react-app todo)
    (create-react-app was already installed)

    0 讨论(0)
  • 2020-12-29 07:05

    Make sure you are not running any antivirus, stop/pause all antivirus or protection software.

    You can also try

    use create-react-app projectname --save
    or create-react-app projectname --save-exact and start again
    

    OR

    as the error suggests, you should use a newer version of node. You are using 8.9.4, you should probably use 8.12.0 LTS.

    0 讨论(0)
  • 2020-12-29 07:05

    The problem on my machine was caused by yarn. I am windows 10 and after uninstalling yarn using npm uninstall -g yarn, my script run correctly. So

    1. Open terminal and type: npm uninstall -g yarn
    2. Once done, close terminal and open new one
    3. type create-react-app (app name) and this should create your app :)

    Please note that the above steps assume that you already have node and react-cli installed on your machine.

    0 讨论(0)
  • 2020-12-29 07:06

    Please try this:

    npm cache clean --force
    
    0 讨论(0)
提交回复
热议问题