我已经从windows开发环境切换到linux环境,但我无法再次运行react-native应用程序。该应用程序使用gradle构建,并通过adb
完美地安装到手机上,当我通过Metro发送应用构建时(npx react-native start
)我得到了下面的反馈。该包存在...所以我不明白为什么它没有找到。我想我不知道我不明白为什么from /home/hovaness/Public/ignitefolderscan/_
在一开始就不是一个真正的目录时返回。
错误
错误:错误:无法从/home/hovaness/Public/ignitefolderscan/_
解析模块/home/hovaness/Public/ignitefolderscan/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro-runtime/src/modules/empty-module.js
:在项目或以下目录中找不到/home/hovaness/Public/ignitefolderscan/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro-runtime/src/modules/empty-module.js
:node_modules
点火开关医生
System
platform linux
arch x64
cpu 20 cores Intel(R) Core(TM) i9-10900X CPU @ 3.70GHz
directory ignitefolderscan /home/hovaness/Public/ignitefolderscan
JavaScript (and globally-installed packages)
node 16.14.2 /bin/node
npm 8.7.0 /home/hovaness/Public/ignitefolderscan/node_modules/.bin/npm
@react-native-community/cli 7.0.3
corepack 0.10.0
expo 44.0.6
jetifier 2.0.0
n 8.1.0
npm 8.7.0
npx 10.2.2
pnpm 7.0.0-rc.6
react-native-cli 2.0.1
yarn 1.22.18
yarn 1.22.18 /bin/yarn
pnpm 7.0.0-rc.6 /bin/pnpm
<no pnpm global package info available>
Ignite
ignite-cli 7.10.8 /home/hovaness/.npm/_npx/e31027f3785124a8/node_modules/.bin/ignite
ignite src build /home/hovaness/.npm/_npx/e31027f3785124a8/node_modules/ignite-cli/build
Android
java 11.0.14.1 /bin/java
android home - undefined
2条答案
按热度按时间wlp8pajw1#
运行
npm audit fix --force
导致软件包升级到彼此不兼容的版本,从而产生此错误。不要盲目运行此命令。4dc9hkyq2#
我也遇到了同样的问题,为了解决这个问题,我做到了:
npm install --force
如果不起作用,请尝试:
npm install --legacy-peer-deps
个