'expo init gives the error "× Something went wrong while downloading and extracting the template. npm exited with non-zero code: 1"

so I am trying to get started with react native

when I tried running expo init it gave me the following error:

√ What would you like to name your app? ... test

√ Choose a template: » minimal

× Something went wrong while downloading and extracting the template.

npm exited with non-zero code: 1
Error: npm exited with non-zero code: 1

any fixes?



Solution 1:[1]

Sort of outdated but figured out that I can use a docker container or WSL.

Solution 2:[2]

I added a parent node to your sample. This produes a list, that you can do with what you want. Please take the time to read the documentation so that you can understand how it works and what options there are.

def xml = '''
<sample>
<Order>
  <Id>8017Z000001Ks6zQAC</Id>
  <CreatedById>0057Z000008KzAtQAK</CreatedById>
  <OwnerId>0057Z000008KzAtQAK</OwnerId>
  <CreatedBy>
   <Name>Sharmila Test Account</Name>
   <Email>[email protected]</Email>
   <Profile>
    <Name>Customer Community Plus User</Name>
   </Profile>
  </CreatedBy>
  <SalesStore>
   <Name>ShopVestas</Name>
  </SalesStore>
 </Order>
<Order>
  <Id>8017Z000002dfBBQAY</Id>
  <CreatedById>0057Z000008KzAtQAK</CreatedById>
  <OwnerId>0057Z000008KzAtQAK</OwnerId>
  <CreatedBy>
   <Name>Sharmila Test Account</Name>
   <Email>[email protected]</Email>
   <Profile>
    <Name>Customer Community Plus User</Name>
   </Profile>
  </CreatedBy>
  <SalesStore>
   <Name>ShopVestas</Name>
  </SalesStore>
 </Order>
</sample>
'''

def sample = new XmlSlurper().parseText(xml)
def emails = sample.'**'.findAll { node -> node.name() == 'Email' }
assert emails == ['[email protected]', '[email protected]']

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AnmolPlayzz
Solution 2 ou_ryperd