Tag: react native

无效的目录Users / node_modules / crypto-browserify反应原生

我正在尝试使用我在github(crypto-browserify)中find的软件包,并使用npm install –save crypto-browserify ,然后用var crypto = require('crypto-browserify');导入它var crypto = require('crypto-browserify'); 。 我似乎无法得到这个工作,我不断得到上述错误,虽然crypto-browserify是在我的项目的节点模块文件夹。 任何帮助非常感谢,我一直在努力解决这个问题!

尝试使用npm安装react-native-cli时,未遵守相关性错误

当我跑步 npm install -g react-native-cli 我看到这个错误 npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules requires graceful-fs@'^4.1.2' but will load npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-installed/node_modules/graceful-fs, npm WARN unmet dependency which is version 3.0.8 我已经尝试通过更新优雅fs npm update -g graceful-fs 反应网站build议使用sudo如果你有权限错误。 这个错误似乎没有相关的权限,但如果是这样,我当然可以运行sudo 。 我是一个npm和节点noob所以请请求任何更多的信息,将有所帮助。

在Ubuntu上的React本机入门套件安装期间,spawn-sync post安装失败

我试图在Ubuntu 14.04.4上安装一个React本地入门工具包(Ignite),并继续得到产卵同步安装后失败。 此前有Eaccess的问题,我通过在这个video中的指示, https://docs.npmjs.com/getting-started/fixing-npm-permissions 节点版本 – v6.3.0 npm版本 – 3.10.3点燃 – https://github.com/infinitered/ignite 当我尝试全局安装点燃,我收到以下错误, npm WARN deprecated cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain, use it instead! npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm /root/.npm-global/bin/ignite -> /root/.npm-global/lib/node_modules/react-native-ignite/index.js spawn-sync@1.0.15 postinstall /root/.npm-global/lib/node_modules/react-native-ignite/node_modules/spawn-sync node […]

React Native与WebSocket不起作用

我听说Socket.io在React Native中没有正常工作,所以我决定使用普通的WebSocket。 我使用node.js来实现WebSocket服务器,并不难。 通过浏览器,我尝试了所有的工作,但与React本地,没有成功。 这些是我试图实现websocket服务器: expression-WS WS 快递只是没有任何错误消息工作。 只是它说没有连接的东西。 所以我把模块改成了ws,这个模块应该是客户端和服务器都需要的,所以我做了。 服务器工作,但是当在AVD上的android应用程序,它说: 需要未知的模块“url”。如果您确定该模块在那里,请尝试重新启动打包程序或运行“npm install”。 所以我完全删除了node_modules目录并重新安装它们,但同样的错误再次出现。 我正在使用节点v6.2.2,并且反应native-cli 1.0.0,react-native 0.33.0。 这是带有ws模块的服务器代码(与ws模块自述文件相同): var WebSocketServer = require('ws').Server; var wss = new WebSocketServer({ port: 3000 }); wss.on('connection', (socket) => { socket.on('message', (msg) => { console.log('Received: ' + msg); }); socket.send('something'); }); 这是客户端: import React, { Component } from 'react'; import { […]

无法安装react-native Nativebase:执行任务失败:app:compileDebugJavaWithJavac'

尝试在Windows 10上为我的React Native项目安装NativeBase时遇到以下问题 react-native init RNapp cd RNapp npm install native-base –save react-native link react-native-vector-icons 编辑android/app/build.gradle并将以下内容添加到文件末尾: apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 运行echo %JAVA_HOME%会给出C:\Program Files\Java\jdk1.8.0_111 现在当我跑步 react-native run-android 生成失败,出现以下错误。 有没有解决这个问题? C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:6: error: cannot find s mbol import com.facebook.react.ReactApplication; ^ symbol: class ReactApplication location: package com.facebook.react C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:9: error: cannot find s mbol import com.facebook.react.ReactNativeHost; ^ symbol: class ReactNativeHost location: […]

在React-Native中使用Node.js内置模块的polyfills

我想在React-Native应用程序中使用的一些Node.js包依赖于Node.js的内置模块,如url , http和crypto 。 这些包被devise成与Webpack一起打包,并利用Webpack的polyfills 。 我已经添加了所需的polyfills到我的根package.json文件,但我仍然看到像在我的应用程序Unable to resolve module 'crypto'错误。 我如何告诉React-Native打包程序使用polyfill而不是尝试加载内置的Node.js模块?

React Native:无法连接到开发服务器

我有一个非常简单的React Native项目,我正在努力工作。 这是一个iOS项目,简单地将RCTRootView添加到UIViewController。 当我从Xcode运行应用程序时,出现错误的红色屏幕: Could not connect to development server. Ensure the following: – Node server is running and available on the same network – run 'npm start' from react-native root – Node server URL is correctly set in AppDelegate AppDelegate.h @property (strong, nonatomic) RCTRootView *rootView; application: didFinishLaunchingWithOptions: AppDelegate.m application: didFinishLaunchingWithOptions: NSURL *jsCodeLocation = [NSURL […]

React Native无法parsing模块../when

我正在尝试使用npm模块,并安装它 npm安装的时候 但是由于某种原因,它一直说即使它在那里也找不到它。 我清除了所有caching并重build了项目。 这是唯一提供任何问题的模块,它说/何时/不存在时。 import when from "when";

我如何使用googleapis进行反应?

目前,我正在尝试使用谷歌驱动器API V3作出反应的本地。 我正在从谷歌驱动器API v3 Node.js作为一个例子。 但问题是,当我试图将googleapis导入到我的项目中显示下面的错误。 我GOOGLE了很多次,但无法find解决scheme。 有人能帮我解决吗?

失败将RemoteDev监视器注入React Nativedebugging器

我正在使用React Native应用程序,并突然看到这个: FAIL Inject RemoteDev monitor into React Native debugger, the file 'react-native\local-cli\server\util\debugger.html' not found. 当我运行npm install 。 它曾经是好的。 我检查了文件夹AppData\Roaming\npm\node_modules\react-native\local-cli\server\util并且debugger.html文件在那里。 这是我的package.json脚本: "postinstall": "remotedev-debugger" 我怎样才能解决这个问题?