首页 > 解决方案 > react-native start 给我错误:找不到模块'source-map'

问题描述

今天,在我的项目上没有触及任何东西,react-native start在终端上运行命令它显示了这个错误:

internal/modules/cjs/loader.js:596
throw err;
^
Error: Cannot find module 'source-map'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
at Function.Module._load (internal/modules/cjs/loader.js:520:25)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/AlterEgo/Google Drive/React/Mono App/v2/Mono/node_modules/source-map-support/source-map-support.js:1:87)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)

我在谷歌上搜索过没有运气......有什么想法吗?提前致谢!

编辑:这里是我的 package.json 项目:

{
  "name": "Mono",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "eslint": "^4.19.1",
    "mobx": "^4.3.1",
    "mobx-react": "^5.2.3",
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-actionsheet": "^2.4.2",
    "react-native-elements": "^0.19.0",
    "react-native-i18n": "^2.0.12",
    "react-native-keyboard-aware-scroll-view": "^0.5.0",
    "react-native-network-info": "^3.2.2",
    "react-native-picker": "^4.3.7",
    "react-native-router-flux": "^4.0.0-beta.32",
    "react-native-select-input-ios": "^1.1.5",
    "react-native-simple-markdown": "^1.1.0",
    "react-native-swipeable": "^0.6.0",
    "react-native-vector-icons": "^4.5.0",
    "react-native-version-number": "^0.3.2",
    "react-navigation": "^1.5.8"
  },
  "devDependencies": {
    "babel-jest": "23.0.0-alpha.0",
    "babel-preset-react-native": "5.0.0",
    "jest": "22.4.2",
    "react-test-renderer": "^16.3.0-alpha.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

节点:v10.8.0 react-native-cli:2.0.1 react-native:0.56.0

标签: javascriptreactjsreact-native

解决方案


推荐阅读