我已经设置了一个新的空白反应本机应用程序。
安装几个节点模块后,出现此错误。
我知道这与看守人没有足够的空间来监视所有文件更改有关。
我想知道什么是最好的行动方案?
我应该node_modules通过将其添加到文件夹来忽略它.watchmanconfig吗?
包.json
{
"name": "project",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/async-storage": "^1.12.0",
"@react-native-community/clipboard": "^1.2.3",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/drawer": "^5.9.0",
"@react-navigation/native": "^5.7.3",
"@react-navigation/stack": "^5.9.0",
"@twotalltotems/react-native-otp-input": "^1.3.11",
"jetifier": "^1.6.6",
"react": "16.13.1",
"react-native": "^0.63.2",
"react-native-barcode-builder": "^2.0.0",
"react-native-biometrics": "^2.1.4",
"react-native-chart-kit": "^6.6.1",
"react-native-gesture-handler": "^1.7.0",
"react-native-image-picker": "^2.3.3",
"react-native-localization": "^2.1.6",
"react-native-paper": "^4.0.1",
"react-native-reanimated": "^1.13.0",
"react-native-safe-area-context": "^3.1.6",
"react-native-screens": "^2.10.1",
"react-native-splash-screen": "^3.2.0",
"react-native-svg": "^12.1.0",
"react-native-swipe-list-view": "^3.2.3",
"react-native-vector-icons": "^7.0.0"
},
"devDependencies": {
"@babel/core": "7.11.4", …Run Code Online (Sandbox Code Playgroud) 根据之前提出的问题如何在react-native的packager中将我的软件包依赖项的特定node_modules列入黑名单?
我在项目根目录中创建了这样一个文件.名称:rn-cli.config.js
我的文件内容:
var blacklist = require('react-native/packager/blacklist');
var config = {
getBlacklistRE(platform) {
return blacklist(platform, [
/node_modules\/react\/lib\/TouchHistoryMath.js/
]);
}
};
module.exports = config;
Run Code Online (Sandbox Code Playgroud)
我试图直接瞄准模块,因为它是唯一一个导致错误的模块,其中两个模块具有相同的名称.
现在当我尝试重新运行我的项目(从xCode开始)时,我仍然得到相同模块的相同重复错误.
除了创建该文件之外,我还需要做些什么吗?
我从 React Native 项目开始,之前是在本机代码中。我想添加 Amazon Lex,所以按照链接中的以下步骤操作
https://aws-amplify.github.io/docs/js/interactions
下面是我的 App.js 文件
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Run Code Online (Sandbox Code Playgroud)
我刚刚设置了放大库并为 LEX 添加了交互,但是当我尝试运行应用程序时开始出现以下错误。在添加之前工作正常......一旦Amplify文件夹被创建并开始出现后端错误......
(节点:26180)未处理的PromiseRejectionWarning:错误:jest-haste-map:Haste模块命名冲突:重复模块名称:myamplifyproject_cfnlambda_87887b9a 路径:C:\Users\temp\Desktop\myAmplifyProject\amplify\backend\interactions\packagefdsrc\6 json 与 C:\Users\temp\Desktop\myAmplifyProject\amplify#current-cloud-backend\interactions\lex900662fd\src\package.json 发生冲突
这个错误是由
hasteImpl为不同的文件返回相同的名称。在 setModule (C:\Users\temp\Desktop\myAmplifyProject\node_modules\jest-haste-map\build\index.js:569:17) at workerReply (C:\Users\temp\Desktop\myAmplifyProject\node_modules\jest-匆忙映射\build\index.js:641:9) at processTicksAndRejections (internal/process/task_queues.js:93:5) at …
javascript amazon-web-services aws-sdk aws-lambda react-native
我已经有一个基于 React for Web 的项目。现在,我在这里创建了一个 React-Native 项目。如果我与 捆绑react-native bundle,react-native 将捆绑我的所有文件,然后提示大量警告。所以我想让react-native忽略/www.
我尝试了这些操作,但没有用:
sharedBlacklistWildcardsin中node_modules/react-native/packager/blacklist.js。.flowconfig.我检查了文档,但没有发现任何有用的东西。我怎么能这样做,或者我的想法是错误的?
我设置了一个新的放大、添加了身份验证和确认后 lambda 函数,以将用户数据移至 DynamoDB。当我运行 NPM start 时,出现以下错误:
无法构造变压器:DuplicateError:重复的文件或模拟。请检查控制台以获取更多信息 setModule (\MyDemo\node_modules\jest-haste-map\build\index.js:543:17) .js:426:22 {
mockPath1: 'amplify#current-cloud-backend\function\FreshAuthPostConfirmation\src\package.json',
mockPath2: 'amplify\backend\function\FreshAuthPostConfirmation\src\package.json' } '''
根据我所读到的内容,#current-cloud-backend 是由 amplify 根据后端文件夹中的文件创建的。看起来 package.json 应该在那里,但我不确定为什么它是一个错误。我在某处看到我应该删除子类重复文件,我认为它是 #current-cloud-backend 中的文件,但是每次我推送它时 amplify 都会继续产生此错误,我如何避免这种情况到底发生了什么?
amazon-web-services amazon-dynamodb aws-lambda react-native aws-amplify
我正在开发 React Native 应用程序,其中包含针对不同可能客户端的不同配置,例如src/config/config.js. 这些配置相当复杂。该文件的结构基于客户端名称作为键,值作为对象条目,例如:
export default {
fooClient: {
apiUrl: "https://foo.example.com/",
barClient: {
apiUrl: "https://bar.example.com/"
}
}
Run Code Online (Sandbox Code Playgroud)
当然,还有很多其他选项键。
构建应用程序时,我通过指定 Android 构建变体知道要为哪个客户端执行此操作,例如:
ENVFILE=.env npx react-native run-android --variant fooDebug --appIdSuffix foo
Run Code Online (Sandbox Code Playgroud)
出于安全原因,我不希望其他客户端的密钥包含在配置文件中。在构建应用程序并将其发送给客户端之前,我可以选择哪些选项来从此文件中删除所有其他客户端配置?
我考虑了以下内容:我修改了打包程序,以便它删除与当前构建变体不对应的键。
我现在有一个 Metro 变压器插件,可以执行以下操作:
const upstreamTransformer = require('metro-react-native-babel-transformer');
module.exports.transform = function(src, filename, options) {
if (typeof src === 'object') {
// handle RN >= 0.46
({ src, filename, options } = src);
}
if (filename.endsWith('config.js')) {
console.log('Transforming ' + filename);
let srcStripped = src.replace(';', '').replace('export default …Run Code Online (Sandbox Code Playgroud) react-native ×7
aws-lambda ×2
javascript ×2
node.js ×2
android ×1
aws-amplify ×1
aws-sdk ×1
node-modules ×1
watchman ×1