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 getting imported #182

Closed
hbhadra73 opened this issue Mar 31, 2021 · 12 comments
Closed

Template not getting imported #182

hbhadra73 opened this issue Mar 31, 2021 · 12 comments
Labels
🙋 help wanted Question about how to implement a feature

Comments

@hbhadra73
Copy link

Describe the bug
Getting an error when initializing the project. The app gets initialized but the the template does not get imported. Not sure if it is a mistake on my side or a bug. Also getting an error in the CLI with the git URL for the template.

To Reproduce
Steps to reproduce the behavior:

  1. Run react-native init galleryv2 --version 0.63.3 --template @thecodingmachine/react-native-boilerplate

Expected behavior
A new react native app with the boilerplate and folder structure should be created.

Screenshots

image

@JeremyDolle
Copy link
Collaborator

Did you run the init cmd with npx ? like npx react-native init galleryv2 --version 0.63.3 --template @thecodingmachine/react-native-boilerplate

@JeremyDolle JeremyDolle added the 🙋 help wanted Question about how to implement a feature label Mar 31, 2021
@hbhadra73
Copy link
Author

hbhadra73 commented Mar 31, 2021

Yes, I did try with npx too. That too did not work.

Error received while trying with npx -
image

@JeremyDolle
Copy link
Collaborator

Did you try npx react-native init galleryv2 --template @thecodingmachine/react-native-boilerplate --version 0.63.3 and without fixing the version npx react-native init galleryv2 --template @thecodingmachine/react-native-boilerplate

Let me know ?

@hbhadra73
Copy link
Author

Did you try npx react-native init galleryv2 --template @thecodingmachine/react-native-boilerplate --version 0.63.3 and without fixing the version npx react-native init galleryv2 --template @thecodingmachine/react-native-boilerplate

Let me know ?

Yes I did try both. Both don't work.

@JeremyDolle
Copy link
Collaborator

It's look like the problem is about npm... what version do you have ?

@hbhadra73
Copy link
Author

It's look like the problem is about npm... what version do you have ?

Had this

npm - 6.14.5
node - 12.18.1

Updated to the latest version i.e. this

npm - 6.14.11
node - 14.16.0

Still did not work

@JeremyDolle
Copy link
Collaborator

JeremyDolle commented Mar 31, 2021

Ok, do your development setup is ok like it's recommended here
Ensure you don't have react-native or react-native-cli installed locally (react-native-cli -v, react-native -v)

Also, Do you try run npx react-native init galleryv2 ?

@hbhadra73
Copy link
Author

Ok, do your development setup is ok like it's recommended here
Ensure you don't have react-native or react-native-cli installed locally (react-native-cli -v, react-native -v)

Also, Do you try run npx react-native init galleryv2 ?

Regarding developement setup, I don't think anything is wrong because I have other react native projects which seem to work completely fine.

react-native -v gave me this output -

react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory

react-native-cli -v gave me this ouput -

react-native-cli : The term 'react-native-cli' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify 
that the path is correct and try again.
At line:1 char:1
+ react-native-cli -v
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (react-native-cli:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Yes, I did try npx react-native init galleryv2
It worked without any errors and created a fresh new react native project.

@JeremyDolle
Copy link
Collaborator

Ok, so now if react-native -v give you result, you have to remove it. Like it's said here: If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues. react-native-cli 2.0.1 is installed in your computer so remove it and run npx react-native init galleryv2 --template @thecodingmachine/react-native-boilerplate. Let me know !

@hbhadra73
Copy link
Author

Ok, so now if react-native -v give you result, you have to remove it. Like it's said here: If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues. react-native-cli 2.0.1 is installed in your computer so remove it and run npx react-native init galleryv2 --template @thecodingmachine/react-native-boilerplate. Let me know !

Okay. Will try this. Thanks a lot for your help. One small question before doing this, will removing react-native-cli affect any of my exisiting projects?

@JeremyDolle
Copy link
Collaborator

No because react-native-cli is used for init projects. Now using npx provide you to use the last released packages without install it in your machine and update it every new release.

@hbhadra73
Copy link
Author

No because react-native-cli is used for init projects. Now using npx provide you to use the last released packages without install it in your machine and update it every new release.

Hey, now it works.
Thanks a lot for your help.
Uninstalling react-native-cli which was installed globally helped.

Command used - npm uninstall -g react-native-cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 help wanted Question about how to implement a feature
Projects
None yet
Development

No branches or pull requests

2 participants