首页 > 解决方案 > 无法加载我的反应原生项目的配置

问题描述

./gradlew cleanandroid 目录中的命令也有问题。我试过降级 npm 版本但没有帮助。有任何想法吗?
以下是我运行时得到的日志npx react-native run-android

 error Failed to load configuration of your project.
    Error: Cannot find module '...\node_modules\json-parse-better-errors\index.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:875:27)
        at Function.Module._load (internal/modules/cjs/loader.js:745:27)
        at Module.require (internal/modules/cjs/loader.js:961:19)
        at require (internal/modules/cjs/helpers.js:92:18)
        at Object.<anonymous> (D:\projects\Beauty\node_modules\parse-json\index.js:3:18)
        at Module._compile (internal/modules/cjs/loader.js:1072:14)
        at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
        at Module.load (internal/modules/cjs/loader.js:937:32)

环境:

操作系统:Windows 10
本机反应:0.65.1
节点:14.17.4
npm:7.23.0

标签: reactjsreact-nativenpm

解决方案


推荐阅读