启动应用程序导致找不到模块错误

时间:2020-08-28 18:01:29

标签: javascript node.js react-native npm expo

当我在git-bash中启动我的react-native应用程序时,它会向我显示此消息。

image for problems

我删除了node.js并重新安装并清理了缓存。我已经尝试了Stack Overflow和GitHub中的所有解决方案,但没有一个对我有用

   $ npm start

> @ start C:\Users\youse\OneDrive\╪│╪╖╪ص ╪د┘„┘à┘â╪ز╪ذ\0\rn-starter
> expo start

[20:51:21] Starting project at C:\Users\youse\OneDrive\╪│╪╖╪ص ╪د┘„┘à┘â╪ز╪ذ\0\rn-starter
[20:51:45] Cannot find module 'C:\Users\youse\AppData\Roaming\npm\node_modules\expo-cli\node_modules\send\node_modules\mime\mime.js'. Please verify that the package.json has a valid "main" entry
[20:51:45] Error: Cannot find module 'C:\Users\youse\AppData\Roaming\npm\node_modules\expo-cli\node_modules\send\node_modules\mime\mime.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:320:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:533:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:879:27)
    at Function.Module._load (internal/modules/cjs/loader.js:742:27)
    at Module.require (internal/modules/cjs/loader.js:964:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\youse\AppData\Roaming\npm\node_modules\expo-cli\node_modules\send\index.js:24:12)
    at Module._compile (internal/modules/cjs/loader.js:1075:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1096:10)
    at Module.load (internal/modules/cjs/loader.js:940:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `expo start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\youse\AppData\Roaming\npm-cache\_logs\2020-08-28T17_51_45_566Z-debug.log

package.json文件在下面

    {
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "dependencies": {
    "@react-native-community/masked-view": "^0.1.5",
    "core-js": "^3.6.5",
    "expo": "~36.0.0",
    "react": "~16.9.0",
    "react-dom": "~16.9.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz",
    "react-native-gesture-handler": "~1.5.0",
    "react-native-reanimated": "~1.4.0",
    "react-native-safe-area-context": "0.6.0",
    "react-native-screens": "2.0.0-alpha.12",
    "react-navigation": "^4.1.0",
    "react-navigation-stack": "^2.0.16"
  },
  "devDependencies": {
    "babel-preset-expo": "~8.0.0",
    "@babel/core": "^7.0.0"
  },
  "private": true
}

1 个答案:

答案 0 :(得分:0)

我找到了解决问题的方法 这条线

with