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

Trouble when building for iOS after install through npm #1

Closed
bolinotkt opened this issue Oct 24, 2018 · 3 comments
Closed

Trouble when building for iOS after install through npm #1

bolinotkt opened this issue Oct 24, 2018 · 3 comments

Comments

@bolinotkt
Copy link

Hello,

I'm pretty new to React Native, I have tried to install react-native-universal-pedometer several times with npm ("npm react-native-universal-pedometer" then "react-native link", and also link Binary With Librairies using "libBMDPedometer.a" in XCode), but I didn't succeed.
When running though iOS simulator, I got this error:

error: bundling failed: ambiguous resolution: module /myreactnativeproject/index.js tries to require react-native, but there are several files providing this module. You can delete or fix them:

  • /myreactnativeproject/node_modules/react-native-universal-pedometer/node_modules/react-native/package.json
  • /myreactnativeproject/node_modules/react-native/package.json

I have tried to remove the "react-native" dependency from the package.json in the "react-native-universal-dependency" directory, but it throws an error.

Have you got any idea on how to solve this? Thanks!

@basvasilich
Copy link

Hi.

I believe there is no react-native dependency in this package.
https://github.com/smekalka/react-native-universal-pedometer/blob/master/package.json#L25

You should try to make clear install of all dependencies. Like rm -rf node_modules && npm install && npm start -- --reset-cache

@prowseed
Copy link

prowseed commented Dec 7, 2018

Same issue here, when building I have:

(node:67336) UnhandledPromiseRejectionWarning: Error: Ambiguous module resolution from `/Users/.../Documents/xxx/App.vue`: The name `react-native` was looked up in the Haste module map. It cannot be resolved, because there exists several different files, or packages, that provide a module for that particular name and platform. The platform is generic (no extension). You must delete or blacklist files until there remains only one of these:
11:08:51: 
11:08:51:   * `/Users/.../Documents/xxx/node_modules/react-native-universal-pedometer/node_modules/react-native/package.json` (package)
11:08:51:   * `/Users/.../Documents/xxx/node_modules/react-native/package.json` (package)

And inside package.json file I see this:

"bundleDependencies": false,
  "dependencies": {
    "react-native": "^0.31.0"
  }

@balthazar
Copy link

This issue should be reopened as no new npm version has been published with the actual fix

For people stumbling upon this issue, install the package using this command instead:

yarn add smekalka/react-native-universal-pedometer

Which will pull it from github directly while waiting for a release

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

No branches or pull requests

4 participants