我在运行时遇到错误npm install。错误是:
npm ERR! Cannot read property 'pickAlgorithm' of null
npm ERR! A complete log of this run can be found in:
npm ERR! npm-cache\_logs\2021-10-14T08_03_47_266Z-debug.log
Run Code Online (Sandbox Code Playgroud)
我执行了以下操作,但错误仍然存在:
node-modulesnpm cache clear --force环境:
操作系统:Windows 10
本机反应:0.65.1
节点:14.17.4
npm:7.21.0
./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)
Run Code Online (Sandbox Code Playgroud)
环境:
操作系统:Windows 10
本机反应:0.65.1
节点:14.17.4
npm:7.23.0