小编Amb*_*ryo的帖子

React Native:找不到模块@react-native-community-cli

在我不得不在我的电脑上重新安装所有东西之前,项目运行良好。运行后出现以下错误npm install,然后expo start

internal/modules/cjs/loader.js:296
      throw err;
      ^

Error: Cannot find module '/home/amber/Documents/GitKraken/school-notification-1/App/node_modules/@react-native-community/cli/build/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:288:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:515:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:759:27)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/home/amber/Documents/GitKraken/school-notification-1/App/node_modules/react-native/local-cli/cli.js:12:11)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/home/amber/Documents/GitKraken/school-notification-1/App/node_modules/@react-native-community/cli/package.json',
  requestPath: '@react-native-community/cli'
}

Metro Bundler process exited with code 1
Run Code Online (Sandbox Code Playgroud)

这是我的 package.json

{
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start", …
Run Code Online (Sandbox Code Playgroud)

react-native

7
推荐指数
2
解决办法
1万
查看次数

标签 统计

react-native ×1