无法在节点模块中找到响应本机提示

问题描述 投票:0回答:1

我已经安装了react-native-prompt。我可以看到它已添加到package.json,但我在node_modules上找不到它 - react-native-prompt中没有node_modules目录。当我尝试导入react-native-prompt时,它表示undefined不是一个对象。这是我的代码:

import React from 'react';
import Prompt from 'react-native-prompt';

const AddTaskPrompt = ({isVisible,onCancelCallBack,onSubmitCallBack}) => (
<Prompt
    title="ajouter une tache"
    placeholder="ex: ramenre du lait"
    defaultValue=""
    visible={isVisible}
    onCancel={() => onCancelCallBack()}
    onSubmit={value => onSubmitCallBack(value)} />
);
export default AddTaskPrompt;

我的package.json的内容看起来像

{
  "name": "fekri4",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "jest-expo": "23.0.0",
    "react-native-scripts": "1.8.1",
    "react-test-renderer": "16.0.0"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "node node_modules/jest/bin/jest.js --watch"
  },
  "jest": {
    "preset": "jest-expo"
  },
  "dependencies": {
    "expo": "^23.0.4",
    "lodash": "^4.17.4",
    "react": "16.0.0",
    "react-native": "0.50.3",
    "react-native-action-button": "^2.8.3",
    "react-native-elements": "^0.18.5",
    "react-native-modal": "^4.1.1",
    "react-native-prompt": "^1.0.0"
  }
}
node.js react-native
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.