反应本机初始化失败
react native init failed
每当我创建一个新项目时,它都会抛出以下错误。我确实更新了任何设置。昨天之前一切正常。这是我的问题。
[1/4] Resolving packages...
error Couldn't find package **"@typescript-eslint/parser@^4.22.1"** required by **"@react-native-community/eslint-config"** on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
E:\example\project\node_modules\execa\index.js:174
err = new Error(`Command failed: ${joinedCmd}${output}`);
^
Error: Command failed: yarn add -D @babel/core @babel/runtime @react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer@17.0.1
at makeError (E:\example\project\node_modules\execa\index.js:174:9)
at E:\example\project\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async generateProject (E:\example\project\node_modules\@react-native-community\cli\build\commands\init\initCompat.js:128:3)
at async Object.initCompat (E:\example\project\node_modules\@react-native-community\cli\build\commands\init\initCompat.js:105:3) {
code: 1,
stdout: null,
stderr: null,
failed: true,
signal: null,
cmd: 'yarn add -D @babel/core @babel/runtime @react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer@17.0.1',
timedOut: false,
killed: false
}
我全部删除了一个节点,更新了节点,删除了react-native-CLI,并更新了它并修复了一段时间。但是我无法安装任何包。
现在是第 2 天,我被困在这里。
在 运行 react-native init 之前尝试 运行 npm install @typescript-eslint/parser@^4.22.1 我希望它能解决问题。
如果问题仍然存在,请尝试使用以下方法清除缓存:
npm 缓存清理 --force
找了半天终于来了。我找到了解决办法。只需转到网络设置并关闭自动代理设置检测。
每当我创建一个新项目时,它都会抛出以下错误。我确实更新了任何设置。昨天之前一切正常。这是我的问题。
[1/4] Resolving packages...
error Couldn't find package **"@typescript-eslint/parser@^4.22.1"** required by **"@react-native-community/eslint-config"** on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
E:\example\project\node_modules\execa\index.js:174
err = new Error(`Command failed: ${joinedCmd}${output}`);
^
Error: Command failed: yarn add -D @babel/core @babel/runtime @react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer@17.0.1
at makeError (E:\example\project\node_modules\execa\index.js:174:9)
at E:\example\project\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async generateProject (E:\example\project\node_modules\@react-native-community\cli\build\commands\init\initCompat.js:128:3)
at async Object.initCompat (E:\example\project\node_modules\@react-native-community\cli\build\commands\init\initCompat.js:105:3) {
code: 1,
stdout: null,
stderr: null,
failed: true,
signal: null,
cmd: 'yarn add -D @babel/core @babel/runtime @react-native-community/eslint-config eslint jest babel-jest metro-react-native-babel-preset react-test-renderer@17.0.1',
timedOut: false,
killed: false
}
我全部删除了一个节点,更新了节点,删除了react-native-CLI,并更新了它并修复了一段时间。但是我无法安装任何包。
现在是第 2 天,我被困在这里。
在 运行 react-native init 之前尝试 运行 npm install @typescript-eslint/parser@^4.22.1 我希望它能解决问题。
如果问题仍然存在,请尝试使用以下方法清除缓存:
npm 缓存清理 --force
找了半天终于来了。我找到了解决办法。只需转到网络设置并关闭自动代理设置检测。