我试图从vercel安装Next.js/Preact.js安装程序,但得到以下错误:
> npx create-next-app --example using-preact using-preact-app
Need to install the following packages:
create-next-app
Ok to proceed? (y) y
Creating a new Next.js app in /home/somayyah/Documents/using-preact-app.
Downloading files for example using-preact. This might take a moment.
Installing packages. This might take a couple of minutes.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: using-preact@1.0.0
npm ERR! Found: react@0.0.3
npm ERR! node_modules/react
npm ERR! react@"npm:@preact/compat@^0.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.6.0 || ^17" from next@10.0.6
npm ERR! node_modules/next
npm ERR! next@"^10.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/somayyah/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/somayyah/.npm/_logs/2021-02-13T17_16_32_165Z-debug.log我试着在另一个项目上自己设置Preact,但我遇到了同样的问题,我如何解决这个问题?
发布于 2021-02-14 07:02:45
我认为这是一个与npx相关的bug。我使用的是yarn create next-app --example using-preact using-preact-app,并且安装成功,但不幸的是,该示例看起来不起作用,并抛出错误Could not find module' webpack
https://stackoverflow.com/questions/66187879
复制相似问题