首页 文章

与UWP反应原生 - 如何设置反应原生的UWP环境?

提问于
浏览
0

我有一个特定的要求,即使用UWP为使用Windows设备创建应用程序时使用react native . 我用谷歌搜索有关UWP支持的Windows原生反应然后我跟着https://github.com/ReactWindows/react-native-windows

我的NPM版本:2.15.9

节点版本:4.6.1

commands i followed:

choco安装nodejs.install

npm install -g react-native-cli

react-native init AwesomeProject

cd AwesomeProject

npm install --save-dev rnpm-plugin-windows

反应原生的窗户

然后我得到了以下错误

E:\ reactApps \ myapp \ sample1> react-native windows E:\ reactApps \ myapp \ sample1 \ node_modules \ react-native \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:176 throw新的ReferenceError(messages.get(“pluginUnknown”,plugin,loc,i,dirname)); ^

ReferenceError:“base”中指定的未知插件“transform-flow-strip-types”为0,尝试解析相对于E的“E:\ reactApps \ myapp \ sample1 \ node_modules \ react-native-windows \ local-cli” :\ actApps \ myapp \ sample1 \ node_modules \ react-native \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:176:17 at Array.map(native)at Function.normalisePlugins(E :OptionManager.mergeOptions上的:\ reactApps \ myapp \ sample1 \ node_modules \ react-native \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:154:20)(E:\ reactApps \ myapp \在OptionManager.init上的sample1 \ node_modules \ react-native \ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:228:36)(E:\ reactApps \ myapp \ sample1 \ node_modules \ react-原生\ node_modules \ babel-core \ lib \ transformation \ file \ options \ option-manager.js:373:12)编译时(E:\ reactApps \ myapp \ sample1 \ node_modules \ react-native \ node_modules \ babel-register \ lib \ node.js:103:45)在loader(E:\ reactApps \ myapp \ sample1 \ node_modu)在\ Object.require.extensions . (匿名函数)[as .js](E:\ reactApps \ myapp \ sample1 \ node_modules \)\ les \ react-native \ node_modules \ babel-register \ lib \ node.js:144:14)在Functional.Module._load的Module.load(module.js:343:32)中的react-native \ node_modules \ babel-register \ lib \ node.js:154:7)(module.js:300:12)

React native ref

1 回答

  • 1

    该问题与您正在使用的NPM版本有关 . 你应该至少使用npm@3.* . 尝试使用 npm upgrade npm@latest 进行升级 .

    之后,您将要删除 node_modules 文件夹并在项目目录中重新运行 npm install .

相关问题