question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 <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.?

github_iconTop GitHub Comments

ramubhaicommented, 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. 😃

1reaction
ramubhaicommented, Oct 15, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Npm install cannot find module 'semver' - Stack Overflow
Try to delete the folder with del npm. Then, if it doesn't allow you to delete a folder, start renaming the folders in...
Read more >
Npm can't find module "semver" error in Ubuntu 19.04
I was basically trying to make offline use of FreeCodeCamp. It asked me to run command 'npm ci' from which I started getting...
Read more >
Fix - Cannot find module 'semver' error in Node.js - Reactgo
The Cannot find module 'semver' error occurs if you're trying to run an npm install command in your project. To solve the error...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
Semantic Versioning 2.0.0. Summary. Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes ...
Read more >
Fix for Cannot Find Module 'Semver' on Ubuntu 20.04 #125
It appears to be an Ubuntu specific problem.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found