react-native start给我错误:无法找到模块'source-map'

时间:2018-08-21 14:52:04

标签: javascript reactjs react-native

今天,在终端上运行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)

我在Google上搜索时没有走运... 有任何想法吗? 预先感谢!

编辑: 这是我的项目的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 反应本机:0.56.0

0 个答案:

没有答案