Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template not found error / with workaround #7

Closed
mikehardy opened this issue Oct 28, 2021 · 9 comments · Fixed by #8
Closed

Template not found error / with workaround #7

mikehardy opened this issue Oct 28, 2021 · 9 comments · Fixed by #8
Assignees
Labels
good first issue Good for newcomers

Comments

@mikehardy
Copy link
Collaborator

mikehardy commented Oct 28, 2021

Describe the bug

Hi there! I was unable to use this template with the provided instructions

To Reproduce

Try to install the template using either the default (yarn)


mike@osxvm-spare:~/work/EquityResidences/equityresidences/packages/public-app (main) % npx react-native init MyAppName --template @plaut-ro/luna --npm
                                                          
               ######                ######               
             ###     ####        ####     ###             
            ##          ###    ###          ##            
            ##             ####             ##            
            ##             ####             ##            
            ##           ##    ##           ##            
            ##         ###      ###         ##            
             ##  ########################  ##             
          ######    ###            ###    ######          
      ###     ##    ##              ##    ##     ###      
   ###         ## ###      ####      ### ##         ###   
  ##           ####      ########      ####           ##  
 ##             ###     ##########     ###             ## 
  ##           ####      ########      ####           ##  
   ###         ## ###      ####      ### ##         ###   
      ###     ##    ##              ##    ##     ###      
          ######    ###            ###    ######          
             ##  ########################  ##             
            ##         ###      ###         ##            
            ##           ##    ##           ##            
            ##             ####             ##            
            ##             ####             ##            
            ##          ###    ###          ##            
             ###     ####        ####     ###             
               ######                ######               
                                                          

                  Welcome to React Native!                
                 Learn once, write anywhere               

✖ Downloading template
error Error: Command failed: npm install --save --save-exact @plaut-ro/luna
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@plaut-ro%2fluna - Not found
npm ERR! 404 
npm ERR! 404  '@plaut-ro/luna@*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

...or npm, neither work:


mike@osxvm-spare:~/work/EquityResidences/equityresidences/packages/public-app (main) % npx react-native init MyAppName --template @plaut-ro/luna --npm
                                                          
               ######                ######               
             ###     ####        ####     ###             
            ##          ###    ###          ##            
            ##             ####             ##            
            ##             ####             ##            
            ##           ##    ##           ##            
            ##         ###      ###         ##            
             ##  ########################  ##             
          ######    ###            ###    ######          
      ###     ##    ##              ##    ##     ###      
   ###         ## ###      ####      ### ##         ###   
  ##           ####      ########      ####           ##  
 ##             ###     ##########     ###             ## 
  ##           ####      ########      ####           ##  
   ###         ## ###      ####      ### ##         ###   
      ###     ##    ##              ##    ##     ###      
          ######    ###            ###    ######          
             ##  ########################  ##             
            ##         ###      ###         ##            
            ##           ##    ##           ##            
            ##             ####             ##            
            ##             ####             ##            
            ##          ###    ###          ##            
             ###     ####        ####     ###             
               ######                ######               
                                                          

                  Welcome to React Native!                
                 Learn once, write anywhere               

✖ Downloading template
error Error: Command failed: npm install --save --save-exact @plaut-ro/luna
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@plaut-ro%2fluna - Not found
npm ERR! 404 
npm ERR! 404  '@plaut-ro/luna@*' is not in this registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Expected behavior

Successful install

Screenshots

Desktop (please complete the following information):

  • OS: macOS 11.6.1

Additional context

I did all the troubleshooting about removing global react-native-cli installs etc - they were not there to begin with (I try to never install global packages...) but I did it just to make sure. You never know! It had no effect.

I was able to do it using the git url though:

npx react-native init MyAppName --template https://github.com/plaut-ro/luna --> success!

it also works with --template plaut-ro/luna which I suppose goes right to github as well, without the @

I generally know my way around the react-native command line (e.g., I script install demos for react-native-firebase, which I maintain, all the time - https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh) but I'm always open to learn something new. Maybe I'm missing something here?

@mikehardy
Copy link
Collaborator Author

One more tidbit:

https://github.com/plaut-ro/luna/blob/master/template/android/gradlew - the main gradlew script, is not executable, I had to chmod 755 android/gradlew before yarn android would work

After figuring out how to reference the template and +x'ing the gradle script it all works though! Fantastic, thank you

@mikehardy
Copy link
Collaborator Author

PR #8 posted to clean both those items up

@LunatiqueCoder
Copy link
Owner

LunatiqueCoder commented Oct 28, 2021

Hello @mikehardy. I am aware of these issues. I moved the repo to plaut-ro and I did not adapt it yet. (Like republishing to npm). I also did not have time to prepare a workflow, but I will take a look at your PR later on, thank you for helping me! :)

@LunatiqueCoder
Copy link
Owner

LunatiqueCoder commented Oct 28, 2021

I invited you as a maintainer. This is the first package I'm maintaining and I appreciate all the help.

@mikehardy
Copy link
Collaborator Author

Ah cool - happy to collaborate. I put out a call on the react-native Discord server for a typescript template that does react-native-web too and it appeared the only thing that currently worked was expo init followed by eject, which isn't the minimal example I was looking for. This was the first one I found that looked relatively minimal, and the parts where it is not minimal are what (almost?) every app needs: the icons and the navigation.

How would you feel - slowly, over time - about two templates, one that is truly minimal - just typescript + multi-platform, along with this one ? Separately, and also slowly over time, maybe broadening to windows/macos? The multi-platform template with typescript space is pretty lacking at the moment!

Finally - any specific reason not to update things where possible (current react-native / react-native-web, for instance?) I'll give those a try locally but can post a PR if they work. In my experience this usually implies the need to integrate patch-package and some patches in order to be compatible (specific example: this patch is probably needed facebook/create-react-app#11338) but having a template lag behind current implies anyone that uses it is already behind things, which is a shame when things like this facebook/react-native#31941 and this facebook/react-native#31480 happen on react-native 0.65 but are fixed on 0.66

@mikehardy
Copy link
Collaborator Author

I posted about this template on that typescript discord channel, if you're interested https://discord.com/channels/514829729862516747/652683748630069248/903279203326259250

@LunatiqueCoder
Copy link
Owner

The only reason I also wanted to use react-native-vector-icons is because I found people complaining that they could not make them work for the web. I also chose to implement react-navigation because I think it offers the best web support.

I mainly made this package to help others. You are clearly much more experienced and that's why I instantly gave you all the privileges you might need to improve. Let's bring multi-platform to everyone. 🥳

All your ideas sound great, and they have already been on my mind to be honest. I was going to bump the versions before actually releasing the package. And yes, windows/macos also sounds great. 🤩

@LunatiqueCoder
Copy link
Owner

@mikehardy I'm sorry, but the discord link is broken for me. 🥺 And I'd like to keep in touch.

@mikehardy
Copy link
Collaborator Author

Oh I see - I investigated and while there are a pile of people in that server it does appear to require an invite. So, I requested one :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants