v0.18 doesn't play nice with react-native-cli?
I just tried to swap react v0.17 for v0.18-rc in my project, and after running
npm install https://github.com/facebook/react-native/archive/v0.18.0-rc.tar.gz
I'm getting the following when running react-native in the cli:
/Users/danny/src/Fitbird/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:181
throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i));
^
ReferenceError: Unknown plugin "syntax-async-functions" specified in "foreign" at 0
at /Users/danny/src/Fitbird/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:181:17
at Array.map (native)
at Function.normalisePlugins (/Users/danny/src/Fitbird/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:163:20)
at OptionManager.mergeOptions (/Users/danny/src/Fitbird/node_modules/react-native/node_modules/babel-core/lib/transformation/file/options/option-manager.js:259:36)
at compile (/Users/danny/src/Fitbird/node_modules/react-native/node_modules/babel-register/lib/node.js:87:15)
at loader (/Users/danny/src/Fitbird/node_modules/react-native/node_modules/babel-register/lib/node.js:128:14)
at Object.require.extensions.(anonymous function) [as .js] (/Users/danny/src/Fitbird/node_modules/react-native/node_modules/babel-register/lib/node.js:138:7)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
Hey israelidanny, thanks for reporting this issue!
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
- If you don't know how to do something or something is not working as you expect but not sure it's a bug, please ask on StackOverflow with the tag
react-nativeor for more real time interactions, ask on Discord in the #react-native channel. - If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
- We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!
The CLI should be fine... try completely deleting node_modules and $TMPDIR/react-*
Just did that (removed node_modules fully, and cleared all caches from npm and temp files), and still - nope, exact same error.
Here is my react-native-cli version:
dannys-imac:Fitbird danny$ react-native --version
react-native-cli: 0.1.8
react-native: 0.18.0-rc
Here is my verbose npm install log:
https://gist.github.com/israelidanny/9de53a11417c344f6640
react-native 0.18.0-rc is not yet published to npm. How did you install it?
npm install https://github.com/facebook/react-native/archive/v0.18.0-rc.tar.gz
I just tried on my local machine and it's working fine. Have you tried uninstalling and reinstalling the react-native-cli paclkage?
Yes, positive - tried that too. Is there any logical debug process for this kind of error?
No idea :(
Also found #4055
I'm seeing this same issue when I try to use my source copy of react-native in my project.
In my project directory:
- rm -rf node_modules/*
- ln -s ../react-native ./react-native
- npm i
- cd node_modules/react-native && npm i
Then when I run 'react-native start' in my project dir I see the error in OP. I also tried 'react-native start --root node_modules/react-native' but see the same error.
I think the problem is that the --root param is being ignored, so react-native/node_modules isn't searched.
Not sure if there's a better/simpler way of using a source copy of react-native as a dependency. How is everyone else doing development of react-native and testing the result in a project?
babel-core before version v6.2.0 uses process.cwd() to resolve plugins while compiling a file.
This error arises if we try to run the packager in our own react-native project directory (which doesn't have the necessary babel plugins installed).
Newer versions of babel-core fixed this problem. Specifically, this commit resolves plugins relative to the file being compiled:
https://github.com/babel/babel/commit/8fd543edae545d6e528e40668d5cade6e3c5fb49#diff-4ba351b92a42899cddf5f8518c289c1d
After upgrading react-native to use newer versions of babel-core, this problem goes away. In particular babel-core 6.4.5 works for me...
@facebook-github-bot answered
Closing this issue as @bestander says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.