You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: bundling failed: ambiguous resolution: module .../index.js tries to require react-native, but there are several files providing this module. You can delete or fix them
#89
Closed
jerinho opened this issue
Nov 27, 2018
· 2 comments
install new package from here. npm i -g git+https://github.com/frostney/react-native-create-library.git
C:\Users\USER\AppData\Roaming\npm\react-native-create-library -> C:\Users\USER\AppData\Roaming\npm\node_modules\react-native-create-library\cli.js
+react-native-create-library@3.1.2
added 91 packages from 39 contributors in 82.13s
react-native-create-library mylib
While RN is the default prefix, it is recommended to customize the prefix.
While {DEFAULT_PACKAGE_IDENTIFIER} is the default package identifier, it is recommended to customize the package identifier.
📚 Created library testlib in ./testlib.
🕘 It took 112ms.
➡️ To get started type cd ./testlib and run npm install
testlib directory not exists. the name is react-native-testlib. so i do cd ./react-native-testlib instead. followed by yarn
yarn install v1.9.4
info No lockfile found.
[1/4] Resolving packages...
warning react-native > connect@2.30.2: connect 2.x series is deprecated
info There appears to be trouble with your network connection. Retrying...
warning react-native-windows > yeoman-generator > cross-spawn > cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead
warning react-native-windows > yeoman-generator > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning react-native-windows > yeoman-generator > sinon > formatio@1.1.1: This package is unmaintained. Use @sinonjs/formatio instead
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 307.98s.
yarn link
yarn link v1.9.4
success Registered "react-native-testlib".
info You can now run yarn link "react-native-testlib" in the projects where you want to use this package and it will be used instead.
Done in 0.12s.
yarn link react-native-testlib on project directory
yarn link v1.9.4
success Using linked package for "react-native-testlib".
Done in 0.15s.
react-native link react-native-testlib. expected automatic installation works perfectly as manual installation. but it's not. so i have to do it manually
react-native run-android working as expected for android part. but metro bundler show compilation error
error: bundling failed: ambiguous resolution: module C:\Users\USER\Desktop\test\index.js tries to require react-native, but there are several files providing this module. You can delete or fix them:
*C:\Users\USER\AppData\Local\Yarn\Data\link\react-native-testlib\node_modules\react-native\package.json
*C:\Users\USER\Desktop\test\node_modules\react-native\package.json
The text was updated successfully, but these errors were encountered:
@jerinho Unfortunately you cannot symlink a react native package. This is a problem with the metro bundler and you can follow the issue here: facebook/metro#1
@jerinho Unfortunately you cannot symlink a react native package. This is a problem with the metro bundler and you can follow the issue here: facebook/metro#1
thank you. but then yarn should not loads packages into node_modules directory. just like how the default "outdated" react-native-create-library works. please kindly let me know if anybody get different result
i had follow the installation instruction properly
npm remove react-native-create-library
npm i -g git+https://github.com/frostney/react-native-create-library.git
react-native-create-library mylib
testlib
directory not exists. the name isreact-native-testlib
. so i docd ./react-native-testlib
instead. followed byyarn
yarn link
yarn link react-native-testlib
on project directoryreact-native link react-native-testlib
. expected automatic installation works perfectly as manual installation. but it's not. so i have to do it manuallyreact-native run-android
working as expected for android part. but metro bundler show compilation errorThe text was updated successfully, but these errors were encountered: