Create React App not installing, showing an error and aborting installation

后端 未结 16 1318
一生所求
一生所求 2021-01-04 13:12

I Reinstalled Node.js and Yarn. Now I am getting this error.

My environment information is:

Node: v8.12.0

NPM: 6.4.1

Yarn: 1.10.1

相关标签:
16条回答
  • 2021-01-04 13:16

    Try this!

    npm install -g npm@latest  
    
    npm install node
    
    
    npm install -g yarn
    
    
    npx create-react-app appname
    
    cd firstapp
    
    yarn start
    
    0 讨论(0)
  • 2021-01-04 13:20

    Once you have cleaned the yarn cache by running:

    yarn cache clean
    

    then subsequent calls to:

    npx create-react-app your-app
    

    will work.

    0 讨论(0)
  • 2021-01-04 13:20

    Best method for windows user is update your yarn If you use npx and got error than update yarn then use npx I have same error in windows 8.1 then I updated yarn and it solved my problem

    Npm I yarn@latest
    npx creat-react-app  app name
    
    0 讨论(0)
  • 2021-01-04 13:21

    Yes, I have the same issue and I am unable to solve but after uninstalling yarn and updating node with the latest version.

    Also, make sure you have installed

    npm i -g create-react-app
    

    after updating the packages.

    Clean the cache also to make it free from bugs this will definitely work

    0 讨论(0)
  • 2021-01-04 13:24

    I encountered the same problem. It seems that this occurs when npm and node installation is broken. However, sometimes clearing cache doesn't work. I had to not just uninstall but delete/purge all npm and node files on my system, and reinstall them back again.

    Remove node and npm

    sudo rm -rf /usr/local/lib/node_modules
    sudo rm -rf ~/.npm
    
    sudo apt remove --purge npm
    sudo apt remove --purge node
    sudo apt remove --purge nodejs
    

    Check if npm and node are removed by running: which node and which npm If you still see some folders, try removing them using:

    sudo apt-get remove nodejs
    sudo apt-get remove npm
    

    Update system, just in case

    sudo apt-get update
    

    Install node and npm

    sudo apt-get install nodejs
    sudo apt-get install npm
    

    Check installation

    npm -v
    node -v
    

    Note: The steps here involve removing existing modules and putting them back again. I also had to manually uninstall nodejs using Programs and Features (for Windows).

    0 讨论(0)
  • 2021-01-04 13:25

    I had same issue and solved it by:

    Installing latest version of node, npm and yarn.

    npm install -g npm@latest
    nvm install node
    npm install -g yarn

    nvm installs Node.js and npm manages packages.

    0 讨论(0)
提交回复
热议问题