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

react-native-env template was not found + npm get not found #7843

Closed
Neaxic opened this issue Aug 28, 2023 · 6 comments
Closed

react-native-env template was not found + npm get not found #7843

Neaxic opened this issue Aug 28, 2023 · 6 comments
Labels

Comments

@Neaxic
Copy link

Neaxic commented Aug 28, 2023

Describe the bug

Setting up a new repo for bit component development, in a react-native envioment. Following your docs + this article.

https://bit.dev/blog/building-scalable-react-native-apps-with-independent-bit-components-lixj8lgq/
https://bit.dev/docs/react-native-env/set-up-your-env

All i have done this far is on a clean repo with nothing, did bit init successfully. Getting the environment set up like you describe in the article and docs seems to be unable

Steps to Reproduce

  1. Clean fresh codebase
  2. Bit init

Either one gives error

  • npm i @teambit/react.react-native-env
  • bit new react-native-env my-workspace --env teambit.react/react-native-env --default-scope org.scope
  • bit create teambit.react/react-native react-native-env

Expected Behaviour

Well id expect it to go through, did the steps in docs & article. - copied the commands directly.

Screenshots, exceptions and logs

image
image

Specifications

  • Bvm version: 0.4.4
  • Bit version: 0.2.24
  • Workspace type: Unsure
  • Node version: v16.15.1
  • npm / yarn version: npm 8.18.0
  • Platform: Windows
@GiladShoham
Copy link
Member

GiladShoham commented Aug 28, 2023

@Neaxic you don't need the npm i command.
Keep in mind that the docs mention bit install not npm install.
You might want to look on the official docs. (The second link)
@NitsanCohen770 @giteden do we have a more up to date tutorial about it?

@Neaxic
Copy link
Author

Neaxic commented Aug 28, 2023

@GiladShoham Noted, however similar error persists when doing bit create & bit new, like the error report states.

@NitsanCohen770
Copy link
Contributor

Hi @Neaxic, sorry for the inconvenience. This blog post is not updated.
Please follow the guide in the react native learn section.
bit new and bit create are also not up to date. There is a big PR that is waiting to get merged, and it will fix it. Good luck! Don't hesitate to contact me for further guidance.

@Neaxic
Copy link
Author

Neaxic commented Aug 28, 2023

@NitsanCohen770 Appreciate your kind and helpful response.
If bit new and bit create does not work though, and the docs you provided states that i should use those. What am i then supposed to do, if my intent is to setup a new react native env.

@NitsanCohen770
Copy link
Contributor

NitsanCohen770 commented Aug 28, 2023

@Neaxic My apologies for the confusion. I understand where the disconnect is happening.

To clarify:

  • The bit new and bit create commands are functioning correctly.
  • The templates you currently see when running bit templates are from the old environments, and they shouldn't be used. The PR I mentioned is intended to resolve this issue by removing these outdated templates.

Once that PR gets merged, you won't see those old templates anymore. If you follow the bit new and bit create commands as outlined in the official docs, they should work perfectly. The primary distinction is the usage of the --aspect flag, which loads the template from the environment.

Again, I'm sorry for the oversight and any inconvenience caused. Please let me know if you face any other issues or need further clarification.

P.S. For future questions, please direct them to our community Slack channel

@gokulkulkarni1987
Copy link

@Neaxic where u able to resolve the issue? I am facing similar issue.

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

No branches or pull requests

4 participants