Getting the following error while executing expo init command

后端 未结 5 801
臣服心动
臣服心动 2020-12-07 03:55
Installing dependencies...
npm WARN deprecated core-js@1.2.7: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version o         


        
相关标签:
5条回答
  • 2020-12-07 04:12

    It appears to be a core-js version issue.

    In package.json, check "expo-core": "version" and if it is lower than the error:You correct the version to fit the error.

    and rm -rf node_modules && npm install

    or

    npm install -g expo-cli
    

    Once you've done it, try running a new expo init.

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

    The default expo-template-blank template points react-native to their own Github repo - installing from a Github repo might cause the NPM to hang or err out for various reasons.

    To work around this ctrl-c to interrupt initialization when it proceeds to install the dependencies after the project scaffolding is done, edit the package.json to install react-native from the NPM registry - for example this is how my dependencies look:

     "dependencies": {
        "expo": "^35.0.1",
        "react": "^16.8.3",
        "react-dom": "^16.8.3",
        "react-native": "^0.59.10"
    //...
    

    Then manually do npm i to install the dependencies and enjoy.

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

    This shows when you dont have git installed. You can follow any of the answers above to get it working on local. But if you're facing this issue in deploying a node app, check the node image you're using for deployment. If it is node: alpine then u will get this error.

    To fix it, you can use node:carbon image.

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

    Just check that you've git installed on your system. otherwise, download it

    Install git from here - https://git-scm.com/downloads

    Your problem will be solved cheers! :)

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

    Please make sure, that you have git installed. NPM requires git for installing some of the packages. You can check if git is installed via:

    git --version
    

    If so, according to the reported issue, removing and reinstalling node_modules should help:

    rm -rf node_modules && npm install
    

    You can also try to resolve the issue with yarn:

    brew install yarn
    npm uninstall -g create-react-native-app
    yarn global add create-react-native-app
    
    0 讨论(0)
提交回复
热议问题