Semver error?
See original GitHub issueDev setup:
react-native-create-bridgeversion: It says not a recognized command. I just installed it today only using npm.react-nativeversion: 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 <space> to select, to toggle all, to inverse selection)Native Module, Native UI Component ? What OS & languages would you like to support? (Press <space> 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.?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10

Top Related StackOverflow Question
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. 😃
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.