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

Semver error? #36

Open
1 of 2 tasks
ramshankerji opened this issue Oct 14, 2017 · 10 comments
Open
1 of 2 tasks

Semver error? #36

ramshankerji opened this issue Oct 14, 2017 · 10 comments
Labels

Comments

@ramshankerji
Copy link

ramshankerji commented Oct 14, 2017

Dev setup:

  • react-native-create-bridge version: It says not a recognized command. I just installed it today only using npm.
  • react-native version: 0.48.4

I am using create-bridge in a:

  • standalone library
  • existing React Native project

What you did:

create-bridge followed by providing all the inputs.

What happened:

create-bridge
? What is your bridge module called? react-native-google-cast-v3
? What type of bridge would you like to create? (Press to select, to toggle all, to inverse selection)Native Module, Native UI Component
? What OS & languages would you like to support? (Press to select,
to toggle all, to inverse selection)Android/Java, iOS/Objective-C
? What directory should we deliver your JS files to? bridgecast
[readAndWriteFiles] Error: Invalid argument not valid semver
at validate (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\node_modules\compare-versions\index.js:32:19)
at Array.forEach (native)
at compareVersions (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\node_modules\compare-versions\index.js:37:18)
at parseFile (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\build\file-operations.js:107:50)
at _callee3$ (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\build\file-operations.js:148:28)
at tryCatch (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\node_modules\regenerator-runtime\runtime.js:65:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\node_modules\regenerator-runtime\runtime.js:299:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\node_modules\regenerator-runtime\runtime.js:117:21)
at step (C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\node_modules\babel-runtime\helpers\asyncToGenerator.js:17:30)
at C:\Users\ram\AppData\Roaming\npm\node_modules\react-native-create-bridge\node_modules\babel-runtime\helpers\asyncToGenerator.js:28:13
√ Your bridge module was successfully created! 🎉

I am new to react-native & nodejs so pardon if I am missing something silly. It says module creation was successful, than why the error messages.?

@ramshankerji
Copy link
Author

ramshankerji commented Oct 14, 2017

Checked, error happens only when we select Andorid/Java. Not happens when only iOS is selected.
Further can reproduce on windows and mac both.

@jarretmoses
Copy link
Collaborator

@RAMUBHAI could you possibly create a reproduction repo? I tried to reproduce on RN 48.4 and 49.0 but am not seeing the error.

@ramshankerji
Copy link
Author

I created a fresh project using react-native init and it worked fine. So there must be some issues with my specific projects. I will updated once I find out what worked.

@ramshankerji
Copy link
Author

ramshankerji commented Oct 15, 2017

Ok. I tracked down the error to versioning style in root level project.json of react-native project.
Following works correctly.

"dependencies": {
"react": "16.0.0-beta.5",
"react-native": "0.49.3"
},

but following fails with an error regarding semver.

"dependencies": {
"react": "16.0.0-beta.5",
"react-native": "^0.49.3"
},

Adding any new dependency using "react-native link" seems to be prefixing the "^" symbol before version. In my case, even the react-native dependency itself had "^0.48.4".

I have put a reproduction repo at following address. Hope you can workout a fix.
https://github.com/ramubhai/DEBUG_BRIDGE

Thanks for all the hard work and patience. :)

@jarretmoses
Copy link
Collaborator

@RAMUBHAI thanks for investigating this. I’ve opened a PR to resolve this issue.

@marchon
Copy link

marchon commented Dec 12, 2017

Thank you for sorting this out!!! Much appreciated. :)

@jarretmoses
Copy link
Collaborator

Getting this package going again. Stay tuned for some updates here.

@DanielBoening
Copy link

Today I encountered the same error. Any reasons the open PR is not merged?

@jarretmoses
Copy link
Collaborator

@DanielBoening I will work on having it in, in the next couple days.

@DanielBoening
Copy link

Awsome! Thank you

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