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

yarn run link? 'link' script does not exist? #2

Open
litt1e-p opened this issue Feb 25, 2018 · 6 comments
Open

yarn run link? 'link' script does not exist? #2

litt1e-p opened this issue Feb 25, 2018 · 6 comments

Comments

@litt1e-p
Copy link

I can not find link script in package.json when using yarn run link to link react native dependencies, can you do some help? thanks

@trazyn
Copy link
Owner

trazyn commented Feb 25, 2018

Sorry it's react-native link, already update README

@litt1e-p
Copy link
Author

there are some errors raised as below:

error: bundling failed: Error: Unable to resolve module `../node_modules/react-native/src/utils/MobxProvider` from `/Users/mac/Desktop/JJJkkk/src/index.js`: The module `../node_modules/react-native/src/utils/MobxProvider` could not be found from `/Users/mac/Desktop/JJJkkk/src/index.js`. Indeed, none of these files exist:
* `/Users/mac/Desktop/JJJkkk/node_modules/react-native/src/utils/MobxProvider(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
  * `/Users/mac/Desktop/JJJkkk/node_modules/react-native/src/utils/MobxProvider/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
    at ModuleResolver.resolveDependency (/Users/mac/Desktop/JJJkkk/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:311:1122)
    at ResolutionRequest.resolveDependency (/Users/mac/Desktop/JJJkkk/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:96:16)
    at DependencyGraph.resolveDependency (/Users/mac/Desktop/JJJkkk/node_modules/metro/src/node-haste/DependencyGraph.js:269:4352)
    at /Users/mac/Desktop/JJJkkk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:201:36
    at Generator.next (<anonymous>)
    at step (/Users/mac/Desktop/JJJkkk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:256:306)
    at /Users/mac/Desktop/JJJkkk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:256:536
    at new Promise (<anonymous>)
    at /Users/mac/Desktop/JJJkkk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:256:217
    at addDependency (/Users/mac/Desktop/JJJkkk/node_modules/metro/src/DeltaBundler/traverseDependencies.js:256:92)
 BUNDLE  [ios, dev] ./index.js ▓░░░░░░░░░░░░░░░ 6.4% (103/407), failed.

did I miss some steps to build it correctly?

@trazyn
Copy link
Owner

trazyn commented Feb 25, 2018

You need to reset npm cache or reinstall modules(rm -rf node_modules/ && npm i)

@litt1e-p
Copy link
Author

same error were still raised.

@trazyn
Copy link
Owner

trazyn commented Feb 25, 2018

The problem caused by babel-plugin-module-resolver, maybe can help for u Support for React Native

@litt1e-p
Copy link
Author

thanks for your answer, now the app could run successfully on my iPhone with react-native start -- --reset-cache & cmd+r in Xcode, but it still could not run in simulator with yarn run ios, the babel-plugin-module-resolver maybe exists some bug there. I do not know why

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

2 participants